Posts

Showing posts with the label audio

Issues with multiple audio files in HTML onclick

Issues with multiple audio files in HTML onclick I am creating an online instrument that has 10 keys, each with a recorded sound to play on click. At the moment it is only playing the first sound and I can't work out what I need to do in my code to get the other audio files to play. I have looked at multiple links to try and solve this but nothing has worked! <h1> Click to Play <script> function play(){ var audio = document.getElementById("audio"); audio.play(); } </script> <img src='https://s3-us-west-2.amazonaws.com/s.cdpn.io/2124473 /Low_2.jpeg' value="PLAY" onclick="play()"><audio id="audio" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/2124473/low%202.mp3" ></audio> <img src='https://s3-us-west-2.amazonaws.com/s.cdpn.io/2124473/Low_3.jpeg' value="PLAY" onclick="play()"><audio id="audio" src="https://s3-us-...

Python reading audio from sound card

Python reading audio from sound card I have a project. What I want to do is that I want to read audio data from soundcard without saving it but the main important thing is that the audio data that the python is reading I want to check if some certain audio is played 1 Answer 1 Before the answer: In SO you should post your initial ideas, and say what you tried. And then the answers can be more relevant and informative. About your question: you can use pyaudio It is: PyAudio provides Python bindings for PortAudio, the cross-platform audio I/O library. With PyAudio, you can easily use Python to play and record audio on a variety of platforms. PyAudio provides Python bindings for PortAudio, the cross-platform audio I/O library. With PyAudio, you can easily use Python to play and record audio on a variety of platforms. There are multiple code examples for it, you can Google it. ...

Javascript make audio blob

Javascript make audio blob I am testing the html audio tag and I would like to make audio blob url's , like youtube or vimeo does, and add it to the "src" to start playing the audio. I've been testing with new Blob() and URL.createObjectURL() but I don't know how to use it. new Blob() URL.createObjectURL() I would like to do something like: <audio controls src"blob:null/8142a612-29ad-4220-af08-9a31c55ed078"></audio> <audio controls src"blob:null/8142a612-29ad-4220-af08-9a31c55ed078"></audio> I would greatly appreciate your help. 1 Answer 1 Suppose you have base64 encoded version of audio like this data="data:audio/ogg;base64,T2dnUwACAAAAAAAAAADSeWyXAU9nZ1MAAAAAAAAAAAAA0nl"; 1.First remove the base64 headers (preamble) and decode it to pure binary form, the form it lies in as in your iPad. You can use convertDataURIToBinar...