# Cloze: play sound only when particular cloze answer is revealed

**URL:** <https://forums.ankiweb.net/t/cloze-play-sound-only-when-particular-cloze-answer-is-revealed/3438>\
**Category:** Card Design\
**Created:** [September 16, 2020, 8:41am UTC](https://forums.ankiweb.net/t/cloze-play-sound-only-when-particular-cloze-answer-is-revealed/3438 "2020-09-16T08:41:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sof](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@sof](https://forums.ankiweb.net/u/sof)\
**Post date:** [September 16, 2020, 8:41am UTC](https://forums.ankiweb.net/t/cloze-play-sound-only-when-particular-cloze-answer-is-revealed/3438/1 "2020-09-16T08:41:54Z")

</div>

I have a language learning cloze card where I want to highlight the equivalency between two sentences:

```
{{c1::Volvamos a casa.}}

{{c2::Vamos}} a volver a casa.

```

I want to get a sound recording of “vamos a volver a casa” to play only when c2 is revealed as the answer. And I want a sound recording of “volvamos a casa” to play when c1 is revealed as the answer.

I have tried the following:

```
{{c1::Volvamos a casa.}}

{{c2::Vamos}} a volver a casa.

{{c1::[sound:volvamos a casa.mp3]}} {{c2::[sound:vamos a volver a casa.mp3]}}

```

However, this plays the sound not only when the relevant cloze is revealed as the answer, but also on the card where it isn’t a cloze question. e.g. you end up with a front-side that looks like this:

```
Volvamos a casa.

[...] a volver a casa.

[sound:volvamos a casa.mp3]

```

…and a back-side like this:

```
Volvamos a casa.

[...] a volver a casa.

[sound:volvamos a casa.mp3][sound:vamos a volver a casa.mp3]

```

Where you what you want is …

```
Volvamos a casa.

[...] a volver a casa.

```

… with a back-side like this:

```
Volvamos a casa.

Vamos a volver a casa.

[sound:vamos a volver a casa.mp3]

```

Is there a way of doing what I want to do here, while still using a cloze card, and taking advantage of the convenience that the cloze system provides (over and above complex custom card templates etc.)

---

<div class="post-metadata">

**Author:** ![kelciour](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/kelciour/32/14770_2.png) [@kelciour](https://forums.ankiweb.net/u/kelciour)\
**Post date:** [September 16, 2020, 8:59am UTC](https://forums.ankiweb.net/t/cloze-play-sound-only-when-particular-cloze-answer-is-revealed/3438/2 "2020-09-16T08:59:59Z")

</div>

> Conditional generation provides a special field so you can check which card you are rendering. If you wanted to display the “hint1” field on the first cloze, and “hint2” field on the second cloze for example, you could use the following template:

```
{{cloze:Text}}

{{#c1}}
    {{Hint1}}
{{/c1}}

{{#c2}}
    {{Hint2}}
{{/c2}}

```

> [Introduction - Anki Manual](https://docs.ankiweb.net/#/templates/generation?id=cloze-templates)

---

<div class="post-metadata">

**Author:** ![sof](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@sof](https://forums.ankiweb.net/u/sof)\
**Post date:** [September 16, 2020, 3:20pm UTC](https://forums.ankiweb.net/t/cloze-play-sound-only-when-particular-cloze-answer-is-revealed/3438/3 "2020-09-16T15:20:09Z")

</div>

Many thanks @kelciour

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [May 1, 2023, 7:43am UTC](https://forums.ankiweb.net/t/cloze-play-sound-only-when-particular-cloze-answer-is-revealed/3438/4 "2023-05-01T07:43:36Z")

</div>

Closed on May 1, 2023, 7:43am UTC


