Flashcards with sound

Forums: 

Hello,

I am redesigning H5P Flashcards so that on click of the card the given sound is being reproduced.

I added it to the semantics.json:

 
"fields": [
              {
                "name": "text",
                "type": "text",
                "label": "Text",
                "importance": "high",
                "optional": true
              },
              {
                "name": "image",
                "type": "image",
                "label": "Image",
                "importance": "high",
                "optional": true
              },
              {
                "name": "audioFile",
                "type": "audio",
                "label": "Sound"
              }
            ]

 and also to the content.json:
"stories": [
        {
          "tip": "",
          "text": "Here's a story!",
          "image": {
            "path": "images/Home.png",
            "mime": "image/png",
            "width": 889,
            "height": 594
          },

          "audioFile": [
            {
              "path": "audios/start.mp3",
              "mime": "audio/mpeg3",
              "copyright": { "license": "U" }
            }
          ]
        }
      ]

Path with images/Home.png is visible, but audios/start.mp3 is not. I added the files tree as attachment. Am I missing something? Best regards, Meri  
Attachments: 

I didn't use H5P.getPath(audioPath, that.id);Now everything works!

 

otacke's picture

Hi!

You'll have to add some JavaScript, too :-) You can find a pull request that would add audio to Flashcards at https://github.com/h5p/h5p-flashcards/pull/64

Best,

Oliver