Questions tagged [audio]
Sound and programming audio hardware, and the various audio formats or containers. For questions specific to sounds playback, use [audio-player] or [playback], and for questions specific to sounds recording, use [audio-recording] or [voice-recording].
36,100
questions
337
votes
18
answers
338k
views
How do I make JavaScript beep?
I want my web page to beep whenever a user exceeds the maximum character limit of my <textarea>.
334
votes
15
answers
467k
views
Convert audio files to mp3 using ffmpeg [closed]
I need to convert audio files to mp3 using ffmpeg.
When I write the command as ffmpeg -i audio.ogg -acodec mp3 newfile.mp3, I get the error:
FFmpeg version 0.5.2, Copyright (c) 2000-2009 Fabrice ...
262
votes
10
answers
258k
views
How to add a new audio (not mixing) into a video using ffmpeg?
I used a command like:
ffmpeg -i video.avi -i audio.mp3 -vcodec codec -acodec codec output_video.avi -newaudio
in latest version for adding new audio track to video (not mix).
But I updated the ...
260
votes
1
answer
169k
views
What are the differences and similarities between ffmpeg, libav, and avconv?
When I run ffmpeg on Ubuntu, it shows:
$ ffmpeg
ffmpeg version v0.8, Copyright (c) 2000-2011 the Libav developers
built on Feb 28 2012 13:27:36 with gcc 4.6.1
This program is not developed anymore ...
226
votes
13
answers
193k
views
Sound alarm when code finishes
I am in a situation where my code takes extremely long to run and I don't want to be staring at it all the time but want to know when it is done.
How can I make the (Python) code sort of sound an "...
194
votes
12
answers
402k
views
How can I play sound in Java?
I want to be able to play sound files in my program. Where should I look?
191
votes
11
answers
265k
views
How to play an android notification sound
I was wondering how I could play a notification sound without playing it over the media stream. Right now I can do this via the media player, however I don't want it to play as a media file, I want ...
187
votes
14
answers
228k
views
HTML5 check if audio is playing?
What's the javascript api for checking if an html5 audio element is currently playing?
175
votes
13
answers
331k
views
Is it possible to style html5 audio tag?
I haven't found any resources on how to do that. Something as simple as changing the color of the player would be nice to have :)
171
votes
13
answers
332k
views
Python: Making a beep noise
I'm trying to get the program to give me a beeping noise. I'm on a windows machine. I've looked at http://docs.python.org/library/winsound.html
But not sure how I can program this with a barcode ...
161
votes
18
answers
94k
views
Stop the 'Ding' when pressing Enter
I have a very simple Windows Forms Application. And, in Windows (or, atleast Windows Forms Applications), when you press Enter while inside a Single-line TextBox Control, you hear a Ding. It's an ...
155
votes
7
answers
322k
views
How to play a sound in C#, .NET
I have a Windows application written in C#/.NET.
How can I play a specific sound when a button is clicked?
154
votes
30
answers
248k
views
How to prevent "The play() request was interrupted by a call to pause()" error?
I made a website where if the user clicks, it plays a sound. To prevent the sound from overlapping, I had to add the code:
n.pause();
n.currentTime = 0;
n.play();
But that causes the error:
The ...
151
votes
25
answers
298k
views
Play audio with Python
How can I play audio (it would be like a 1 second sound) from a Python script?
It would be best if it was platform independent, but firstly it needs to work on a Mac.
I know I could just execute the ...
149
votes
14
answers
158k
views
How do I record audio on iPhone with AVAudioRecorder?
Now that iPhone 3.0 SDK is public, I think I can ask this question for those of you that have already been playing with the 3.0 SDK. I want to record audio in my application, but I want to use ...
144
votes
11
answers
209k
views
How to play a notification sound on websites?
When a certain event occurs, I want my website to play a short notification sound to the user.
The sound should not auto-start (instantly) when the website is opened.
Instead, it should be played on ...
143
votes
6
answers
121k
views
Play audio file from the assets directory
I have the following code:
AssetFileDescriptor afd = getAssets().openFd("AudioFile.mp3");
player = new MediaPlayer();
player.setDataSource(afd.getFileDescriptor());
player.prepare();
player.start(...
143
votes
4
answers
206k
views
Node.js can't create Blobs? [duplicate]
I am working with node.js and I streamed my Audio to my node.js server.
Now I noticed during the process of building the audio blob:
var audioBlob = new Blob([dataview], { type: 'audio/wav' });
That ...
125
votes
14
answers
356k
views
Reading *.wav files in Python
I need to analyze sound written in a .wav file. For that I need to transform this file into set of numbers (arrays, for example). I think I need to use the wave package. However, I do not know how ...
124
votes
6
answers
149k
views
How can I make the computer beep in C#?
How do I make the computer's internal speaker beep in C# without external speakers?
123
votes
15
answers
447k
views
Playing .mp3 and .wav in Java?
How can I play an .mp3 and a .wav file in my Java application? I am using Swing. I tried looking on the internet, for something like this example:
public void playSound() {
try {
...
121
votes
5
answers
123k
views
How are VST Plugins made?
I would like to make (or learn how to make) VST plugins. Is there a special SDK for this? how does one yield a .vst instead of a .exe? Also, if one is looking to make Audio Units for Logic Pro, how is ...
118
votes
10
answers
486k
views
Play a Sound with Python [duplicate]
What's the easiest way to play a sound file (.wav) in Python? By easiest I mean both most platform independent and requiring the least dependencies. pygame is certainly an option, but it seems ...
113
votes
3
answers
103k
views
FFMPEG mux video and audio (from another video) - mapping issue
I would like to place the audio from a video to another video without an audio (in one command):
ffmpeg.exe -i video1_noAudio.mov -i video2_wAudio.mov -vcodec copy -acodec copy video1_audioFromVideo2....
111
votes
4
answers
64k
views
Analyze audio using Fast Fourier Transform
I am trying to create a graphical spectrum analyzer in python.
I am currently reading 1024 bytes of a 16 bit dual channel 44,100 Hz sample rate audio stream and averaging the amplitude of the 2 ...
105
votes
24
answers
123k
views
Creating and playing a sound in swift
So what I want to do is create and play a sound in swift that will play when I press a button, I know how to do it in Objective-C, but does anyone know how to in Swift?
It would be like this for ...
104
votes
10
answers
175k
views
Play audio from a stream using C#
Is there a way in C# to play audio (for example, MP3) direcly from a System.IO.Stream that for instance was returend from a WebRequest without saving the data temporarily to the disk?
Solution with ...
102
votes
10
answers
99k
views
Playing an arbitrary tone with Android
Is there any way to make Android emit a sound of arbitrary frequency (meaning, I don't want to have pre-recorded sound files)?
I've looked around and ToneGenerator was the only thing I was able to ...
99
votes
4
answers
54k
views
Understanding FFT output
I need some help understanding the output of the DFT/FFT computation.
I'm an experienced software engineer and need to interpret some smartphone accelerometer readings, such as finding the principal ...
98
votes
8
answers
94k
views
Why does FFT produce complex numbers instead of real numbers?
All the FFT implementations we have come across result in complex values (with real and imaginary parts), even if the input to the algorithm was a discrete set of real numbers (integers).
Is it not ...
98
votes
7
answers
90k
views
How to overlay/downmix two audio files using ffmpeg
Can I overlay/downmix two audio mp3 files into one mp3 output file using ffmpeg?
92
votes
16
answers
209k
views
Autoplay audio files on an iPad with HTML5
I'm trying to get an audio file to autoplay in Safari on an iPad. If I go to the page using Safari on my Mac, it's fine. On the iPad, autoplay does not work.
92
votes
6
answers
104k
views
Using ffmpeg to cut audio from/to position
I need to cut parts from an audio file from position to position. When I tried this command
ffmpeg -ss 132 -t 139 -i original.mp3 new.mp3
it started at the second 132, and added the next 139 ...
90
votes
10
answers
197k
views
Playing sound notifications using Javascript?
How can I do that, so whenever a user clicks a link we play a sound? Using javascript and jquery here.
89
votes
6
answers
81k
views
java.io.IOException: mark/reset not supported
try {
//String location = dir1.getCanonicalPath()+"\\app_yamb_test1\\mySound.au";
//displayMessage(location);
AudioInputStream audio2 = AudioSystem.getAudioInputStream(getClass()....
88
votes
17
answers
383k
views
Playing mp3 song on python
I want to play my song (mp3) from python, can you give me a simplest command to do that?
This is not correct:
import wave
w = wave.open("e:/LOCAL/Betrayer/Metalik Klinik1-Anak Sekolah.mp3","r")
83
votes
8
answers
137k
views
How to generate audio from a numpy array?
I want to create "heart rate monitor" effect from a 2D array in numpy and want the tone to reflect the values in the array.
80
votes
8
answers
57k
views
Generating sound on the fly with javascript/html5
Is it possible to generate a constant sound stream with javascript/html5? For example, to generate a perpetual sine wave, I would have a callback function, that would be called whenever the output ...
80
votes
10
answers
93k
views
How to detect the BPM of a song in php [closed]
How can the tempo/BPM of a song be determined programmatically? What algorithms are commonly used, and what considerations must be made?
80
votes
10
answers
61k
views
Cross-platform, cross-browser way to play sound from Javascript? [duplicate]
I am writing a dhtml application that creates an interactive simulation of a system. The data for the simulation is generated from another tool, and there is already a very large amount of legacy ...
79
votes
3
answers
24k
views
How bad is Android SoundPool? What alternative to use?
I was looking at Android's SoundPool as a mechanism to implement sound effects in my generic game development library. It seemed ideal.
But a little bit of research indicates that there all kinds of ...
77
votes
5
answers
142k
views
Download only audio from youtube video using youtube-dl in python script
There's a few posts on downloading audio from YouTube using youtube-dl, but none of them are concrete or too helpful. I'm wondering what the best way to do it from a Python script is.
For example, ...
75
votes
7
answers
101k
views
Get URI of .mp3 file stored in res/raw folder in android
I have many .mp3 files stored in res/raw folder.
I am getting URI of .mp3 file using following code.
Uri.parse("android.resource:///com.my.android.sharesound/"+resId);
This returns : android....
75
votes
12
answers
142k
views
Get .wav file length or duration
I'm looking for a way to find out the duration of a audio file (.wav) in python. So far i had a look at python wave library, mutagen, pymedia, pymad i was not able to get the duration of the wav file. ...
75
votes
7
answers
87k
views
Python Sound ("Bell")
I'd like to have a python program alert me when it has completed its task by making a beep noise. Currently, I use import os and then use a command line speech program to say "Process complete&...
74
votes
4
answers
56k
views
How to play audio in background with Swift?
As you see I'm streaming an audio broadcast. But when I press the home button and exit the app streaming stops or I cannot hear. How can I continue streaming in background and listen it from lock ...
73
votes
10
answers
186k
views
Download the best quality audio file with youtube-dl [closed]
I have just download youtube-dl so I can download video and audio files from youtube.
I want to download the best audio from the following video: https://www.youtube.com/watch?v=uWusmdmc0to
When I ...
73
votes
3
answers
57k
views
Using the Apple FFT and Accelerate Framework
Has anybody used the Apple FFT for an iPhone app yet or know where I might find a sample application as to how to use it? I know that Apple has some sample code posted, but I'm not really sure how to ...
73
votes
10
answers
111k
views
Why can't JavaScript .play() audio files on iPhone safari?
I've got a JavaScript web app working that plays some audio periodically like this:
var SOUND_SUCCESS = new Audio('success.mp3');
SOUND_SUCCESS.play();
This works great on desktop browsers (tested in ...
73
votes
8
answers
105k
views
Playing a sound with AVAudioPlayer
I'm trying to play a sound with AVAudioPlayer but it won't work.
Edit 1: Still doesn't work.
Edit 2: This code works. My device was in silent mode.
import UIKit
import AVFoundation
class ...