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].

audio
Filter by
Sorted by
Tagged with
28 votes
16 answers
56k views

Pygame, sounds don't play

I'm trying to play sound files (.wav) with pygame but when I start it I never hear anything. This is the code: import pygame pygame.init() pygame.mixer.init() sounda= pygame.mixer.Sound("...
kettlepot's user avatar
  • 10.8k
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 { ...
Stan's user avatar
  • 3,669
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?
pek's user avatar
  • 18k
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 ...
Jeremy Logan's user avatar
  • 47.3k
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 ...
why's user avatar
  • 24.4k
175 votes
14 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 :)
rabidmachine9's user avatar
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 ...
Claudiu's user avatar
  • 227k
58 votes
10 answers
176k views

How to play .wav files with java

I am trying to play a *.wav file with Java. I want it to do the following: When a button is pressed, play a short beep sound. I have googled it, but most of the code wasn't working. Can someone give ...
greenLizard's user avatar
  • 2,326
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>.
Slim's user avatar
  • 5,855
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 ...
Ian Oswald's user avatar
  • 1,365
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 ...
Jim Zimmerman's user avatar
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 ...
Jake Stevenson's user avatar
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 ...
Martin's user avatar
  • 10.8k
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")
The Mr. Totardo's user avatar
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 ...
Josh Hunt's user avatar
  • 14.4k
261 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 ...
Vetalll's user avatar
  • 3,594
39 votes
5 answers
128k views

Play WAV file in Python

I tried PyGame for playing a WAV file like this: import pygame pygame.init() pygame.mixer.music.load("mysound.wav") pygame.mixer.music.play() pygame.event.wait() but It change the voice ...
nim4n's user avatar
  • 1,823
19 votes
3 answers
21k views

Android MediaPlayer works fine in Custom audio Streaming application up to Android 2.1 but not in higher versions

EDIT: Android 2.2 MediaPlayer is working fine with one SHOUTcast URL but not with the other one I need to play audio files from external URLs(shoutcast stream). Currently the audio files are ...
7 votes
7 answers
44k views

Playing MP3 using Java Sound API

Can you please suggest that how can i write a piece that plays a song.? I tried the following snippet but i get the this exception: import sun.audio.*; import java.io.*; class tester { public ...
Suhail Gupta's user avatar
  • 22.8k
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(...
Catalin Morosan's user avatar
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 ...
Roman's user avatar
  • 128k
69 votes
5 answers
59k views

How can I record a conversation / phone call on iOS?

Is it theoretically possible to record a phone call on iPhone? I'm accepting answers which: may or may not require the phone to be jailbroken may or may not pass apple's guidelines due to use of ...
Adam Dempsey's user avatar
  • 2,923
55 votes
8 answers
48k views

How to programmatically sense the iPhone mute switch?

I can't seem to find in the SDK how to programatically sense the mute button/switch on the iPhone. When my app plays background music, it responds properly to the volume button without me having any ...
Olie's user avatar
  • 24.7k
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.
milesmeow's user avatar
  • 3,757
34 votes
7 answers
54k views

Detecting whether a headset is plugged into an Android device or not.

How can I determine whether a headset is plugged into an Android device or not?
coderslay's user avatar
  • 14.2k
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 ...
do it better's user avatar
  • 4,737
65 votes
7 answers
107k views

How to programmatically set the system volume?

How can I change the Windows System Sound Volume using a C# Application?
LostPhysx's user avatar
  • 3,593
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.
Ali's user avatar
  • 265k
20 votes
2 answers
25k views

Detect silence when recording

How can I detect silence when recording operation is started in Java? What is PCM data? How can I calculate PCM data in Java? I found the solution : package bemukan.voiceRecognition.speechToText; ...
olyanren's user avatar
  • 1,448
17 votes
4 answers
30k views

Join two WAV files from Java?

What's the simplest way to concatenate two WAV files in Java 1.6? (Equal frequency and all, nothing fancy.) (This is probably sooo simple, but my Google-fu seems weak on this subject today.)
krosenvold's user avatar
  • 76.3k
72 votes
7 answers
331k views

Javascript Audio Play on click

I have a JavaScript code to play a sound on click. It works on Chrome but on Firefox it starts on load. Can anyone help? <script> var audio = new Audio("http://music.ogg"); audio....
dA_uNknOwN's user avatar
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?
Khilen Maniyar's user avatar
73 votes
12 answers
150k views

HTML 5 video or audio playlist

Can I use a <video> or <audio> tag to play a playlist, and to control them? My goal is to know when a video/song has finished to play and take the next and change its volume.
xdevel2000's user avatar
20 votes
7 answers
21k views

Does java have built in libraries for audio _synthesis_?

Note: I do NOT want to "read audio file foo.bar and play it." I want to programmatically generate audio files on the fly and play them. Does Java have built in libraries for this, or does this fall ...
anon's user avatar
  • 41.8k
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?
Faisal's user avatar
  • 1,337
47 votes
2 answers
34k views

Make movie file with picture Array and song file, using AVAsset

I'm trying to make movie file using a picture array and an audio file. To make movie with a picture array i used the big post by zoul here. All is perfect, I have my movie with my picture. However ...
TheRonin's user avatar
  • 1,315
28 votes
6 answers
55k views

How to handle background audio playing while iOS device is locked or on another application?

Designing a generative music system for iOS, using OpenFrameworks, I'd need to provide a mode in which the user could listen the music produced by the application when: the device is locked the user ...
gluon's user avatar
  • 662
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 ...
Owen M's user avatar
  • 2,655
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 ...
zer02's user avatar
  • 4,001
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()....
Crais's user avatar
  • 903
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?
user avatar
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....
Kartik Domadiya's user avatar
68 votes
12 answers
174k views

What is the best way to merge mp3 files? [closed]

I've got many, many mp3 files that I would like to merge into a single file. I've used the command line method copy /b 1.mp3+2.mp3 3.mp3 but it's a pain when there's a lot of them and their namings ...
Dan Williams's user avatar
  • 4,920
56 votes
9 answers
63k views

Sound not working in iPhone Simulator?

Somehow my iPhone Simulator is unable to play sounds. First an app I'm working on using AudioServicesPlaySystemSound() stopped working.. I spent a while debugging this but sound is still working on ...
pix0r's user avatar
  • 31.2k
35 votes
8 answers
63k views

How to join two wav files using python?

I am using python programming language,I want to join to wav file one at the end of other wav file? I have a Question in the forum which suggest how to merge two wav file i.e add the contents of one ...
kaushik's user avatar
  • 5,789
29 votes
9 answers
101k views

Java - reading, manipulating and writing WAV files

In a Java program, what is the best way to read an audio file (WAV file) to an array of numbers (float[], short[], ...), and to write a WAV file from an array of numbers?
yonatan's user avatar
  • 291
20 votes
2 answers
15k views

How do I use audio sample data from Java Sound?

This question is usually asked as a part of another question but it turns out that the answer is long. I've decided to answer it here so I can link to it elsewhere. Although I'm not aware of a way ...
Radiodef's user avatar
  • 37.5k
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 ...
ninjasense's user avatar
  • 13.8k
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?
Harry's user avatar
  • 54.1k
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 ...
bendr's user avatar
  • 2,475

1
2 3 4 5
88