playback

Recording Audio and Playing Audio at the same time

。_饼干妹妹 提交于 2019-12-10 18:27:20
问题 In my application i am recording input from the microphone and at a certain point i am playing a sound (while the recording is still going). Now the recorder "stops" to record (mrec.stop() may still be used), the LogCat entry for this seems to be: 07-03 18:40:34.811: INFO/AudioHardwareALSA(2179): Output standby called!!. Turn off PCM device. I am testing on two phones, one is a Samsung Galaxy S and one is a Samsung Galaxy 3. On the Galaxy S everything works as expected (which is that the

Stop the audio from playing in pydub

拥有回忆 提交于 2019-12-10 12:07:02
问题 Is there something like terminate or stop feature in pydub such that the stream after started by play() can be stopped abruptly while it is still playing instead of the audio being played to it's full length and then stopping. 回答1: There is no direct way to stop an playing audio in pydub at this time since it can either use pyaudio or ffplay in the backend (depending on what's installed and accessible). See details on backend code here However, you can hit Ctrl + c to break the play and wrap

How to stop music started via SndPlaySound

十年热恋 提交于 2019-12-10 09:43:27
问题 At this Website I found how to add music into a .res file and then use it in your delphi .exe. Here is the code for starting the WAVE song. procedure TForm2.FormActivate(Sender: TObject); var hFind, hRes: THandle; Song: PChar; begin hFind := FindResource(HInstance, 'SonicSong', 'WAVE') ; if hFind <> 0 then begin hRes:=LoadResource(HInstance, hFind) ; if hRes <> 0 then begin Song:=LockResource(hRes) ; if Assigned(Song) then SndPlaySound(Song, snd_ASync or snd_Memory) ; UnlockResource(hRes) ;

How can I tell if an HTML5 Audio element is playing with Javascript

时间秒杀一切 提交于 2019-12-10 03:34:12
问题 I have an audio element in a webpage, and I want to ensure that a user is not still playing it when they leave the page. How can I be sure the audio element is not playing when the page is unloaded? So far, I have the following code, but it doesn't seem to work; the dialog that pops up upon unload reports that playing is false even when the audio is playing: <!DOCTYPE HTML><html> <head> <script><!-- Loading Scripts --> function unloadTasks(){ if (playing && !window.confirm("A podcast is

How to play InputStream of an audio file that's not within a url or storage?

纵饮孤独 提交于 2019-12-08 17:01:03
问题 Background I've succeeded uploading an audio file (3gp) into Google-Drive. Now I want to be able to play the file within the app. The Google Drive API only allows to get the input stream of the file that's stored there. The problem All MediaPlayer capabilities of inputs aren't available in my case, which is only InputSteam: http://developer.android.com/reference/android/media/MediaPlayer.html#setDataSource(java.io.FileDescriptor) I know I can save the file from the Google-Drive to the cache

How to play a background music and make it loop?

和自甴很熟 提交于 2019-12-08 12:11:32
问题 How to play a background music and make it loop? Currently I'm using this piece of code to make it play the background music: XNA-C# SoundEffect bgEffect; bgEffect = Content.Load<SoundEffect>("EpicUnease"); bgEffect.Play(0.1f, 0.0f, 0.0f); 回答1: If this is not XNA, you can reference System.Media and do this: SoundPlayer sound = new SoundPlayer("path");` sound.PlayLooping(); For XNA you would do something like this: SoundEffect bgEffect; bgEffect = Content.Load<SoundEffect>("EpicUnease");

“Function was not implemented” when trying to use ONI recording

烂漫一生 提交于 2019-12-08 10:43:50
问题 I'm trying to use an oni recording in my application using OpenNI. Here is my xml file: <OpenNI> <Licenses> <!-- Add application-specific licenses here <License vendor="vendor" key="key"/> --> </Licenses> <Log writeToConsole="false" writeToFile="false"> <!-- 0 - Verbose, 1 - Info, 2 - Warning, 3 - Error (default) --> <LogLevel value="3"/> <Masks> <Mask name="ALL" on="true"/> </Masks> <Dumps> </Dumps> </Log> <ProductionNodes> <Recording file="Recording.oni" /> <!-- Set global mirror -->

Android: Mediaplayer stop / start playing raw resource

爷,独闯天下 提交于 2019-12-08 05:15:47
问题 It now plays on first press, stops on second press or press of another sound button. If I let a sound play through I can restart it or play another sound on a single press. My goal is for the second press of the same button to stop it, but the press of a new button to just start the new sound instead of first press of new button stopping the old sound, second press starting the new sound. I can see why it does what it does now but am not sure how to make it work the way I want. public void

java.io.IOException: mark/reset not supported

≯℡__Kan透↙ 提交于 2019-12-08 02:50:02
问题 This code does not work. I took a class ready since it can be found here, but the music does not work. How can I fix this? private void lblCliqueMouseClicked(java.awt.event.MouseEvent evt){ lblClique.setText("achou"); musica = new Som(); boolean repetir = false; FileInputStream arquivo = null; try { arquivo = new FileInputStream("musica.mp3"); } catch (FileNotFoundException ex) { Logger.getLogger(TelaProjeto.class.getName()).log(Level.SEVERE, null, ex); } musica.tocar(arquivo, repetir); } 回答1

Android: Mediaplayer stop / start playing raw resource

不想你离开。 提交于 2019-12-07 20:19:27
It now plays on first press, stops on second press or press of another sound button. If I let a sound play through I can restart it or play another sound on a single press. My goal is for the second press of the same button to stop it, but the press of a new button to just start the new sound instead of first press of new button stopping the old sound, second press starting the new sound. I can see why it does what it does now but am not sure how to make it work the way I want. public void playSound(int input){ if (mp!=null && mp.isPlaying()) { mp.stop(); mp.reset(); } else{ if (mp!=null){ mp