Playing sound notifications using Javascript?
Use this plugin: https://github.com/admsev/jquery-play-sound $.playSound(‘http://example.org/sound.mp3’);
Use this plugin: https://github.com/admsev/jquery-play-sound $.playSound(‘http://example.org/sound.mp3’);
stereo + stereo → stereo Normal downmix Use the amix filter: ffmpeg -i input0.mp3 -i input1.mp3 -filter_complex amix=inputs=2:duration=longest output.mp3 Or the amerge filter: ffmpeg -i input0.mp3 -i input1.mp3 -filter_complex amerge=inputs=2 -ac 2 output.mp3 Downmix each input into specific output channel Use the amerge and pan filters: ffmpeg -i input0.mp3 -i input1.mp3 -filter_complex “amerge=inputs=2,pan=stereo|c0<c0+c1|c1<c2+c3” output.mp3 mono … Read more
I would like to also emphasize that the reason you cannot do this is a business decision that Apple made, not a technical decision. To wit, there was no rational technical justification for Apple to disable sound from web apps on the iPod Touch. That is a WiFi device only, not a phone that may … Read more
The FFT is fundamentally a change of basis. The basis into which the FFT changes your original signal is a set of sine waves instead. In order for that basis to describe all the possible inputs it needs to be able to represent phase as well as amplitude; the phase is represented using complex numbers. … Read more
I originally found this example code on a blog, but it had some bugs in it that generated some horrendous sounds. I’ve fixed the bugs and posted the resulting code here. Seems to work well for me! public class PlaySound extends Activity { // originally from http://marblemice.blogspot.com/2010/04/generate-and-play-tone-in-android.html // and modified by Steve Pomeroy <steve@staticfree.info> private … Read more
Overview of inputs input_0.mp4 has the desired video stream and input_1.mp4 has the desired audio stream: In ffmpeg the streams look like this: $ ffmpeg -i input_0.mp4 -i input_1.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘input_0.mp4’: Duration: 00:01:48.50, start: 0.000000, bitrate: 4144 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280×720, 4014 kb/s, SAR 115:87 … Read more
Edit: Answer updated to reflect changes in recent versions of NAudio It’s possible using the NAudio open source .NET audio library I have written. It looks for an ACM codec on your PC to do the conversion. The Mp3FileReader supplied with NAudio currently expects to be able to reposition within the source stream (it builds … Read more
This is similar to some other answers, but perhaps a little more “Swifty”: // Load “mysoundname.wav” if let soundURL = Bundle.main.url(forResource: “mysoundname”, withExtension: “wav”) { var mySound: SystemSoundID = 0 AudioServicesCreateSystemSoundID(soundURL as CFURL, &mySound) // Play AudioServicesPlaySystemSound(mySound); } Note that this is a trivial example reproducing the effect of the code in the question. You’ll … Read more
The array you are showing is the Fourier Transform coefficients of the audio signal. These coefficients can be used to get the frequency content of the audio. The FFT is defined for complex valued input functions, so the coefficients you get out will be imaginary numbers even though your input is all real values. In … Read more
For Windows, you can use winsound. It’s built in import winsound winsound.PlaySound(‘sound.wav’, winsound.SND_FILENAME) You should be able to use ossaudiodev for linux: from wave import open as waveOpen from ossaudiodev import open as ossOpen s = waveOpen(‘tada.wav’,’rb’) (nc,sw,fr,nf,comptype, compname) = s.getparams( ) dsp = ossOpen(‘/dev/dsp’,’w’) try: from ossaudiodev import AFMT_S16_NE except ImportError: from sys import … Read more