Specific sound when specific food is eaten

Hey everyone ! 🙂 I want to play a different sound for each type of food, I saw on this discord that I have to use advancements. I did this for the advancement :

    "criteria": {
      "magic_apple": {
        "trigger": "minecraft:item_used_on_block",
        "conditions": {
          "location": [
            {
              "predicate": {
                "items": ["minecraft:apple"],
                "nbt": "{CustomModelData:1001}"
              }
            }
          ]
        }
      }
    }
  }```
And this for the function : 
```execute as @a[advancements={custom_food:magic_apple=true}] run playsound minecraft:custom_food.magic_apple master @s ~ ~ ~ 1
execute as @a[advancements={custom_food:magic_apple=true}] run advancement revoke from @s from custom_food:magic_apple``` but it doesn't work as I would like to haha.
Thanks for any answer 🙂
Continue to help post