audio

Play song at specific time position from a playlist

不想你离开。 提交于 2021-01-28 02:16:23
问题 I am using jPlayer plugin. In example there are 13 songs in playlist. I want to set a start time (currentTime) for each song like : 1st song starts from 2 sec, 2nd song start from 3 sec and 5th song start from 4 sec. Here is an example jsFiddle. In this example I added var tag = $('.audio-tag audio')[0]; to find current playing song globally but it is out of jPlayer plugin. How to get current audio tag & number to set currentTime for each song of jPlayer playlist? 回答1: SOLUTION var $jp = $('

How to stop all sounds in activity?

大憨熊 提交于 2021-01-28 01:25:41
问题 I have a lot of Mediaplayer sounds in my application acitvity and i have button to stop all sounds that are playing but its taking a lot of space and i want to know the code how to stop all the mediplayer sounds at same time not like this : sadegfqc.pause(); dsfsdf.pause(); sadfsadfsad.pause(); dsfg.pause(); htzh.pause(); nensmene.pause(); fdshs.pause(); gshtrhtr.pause(); hfshztjr.pause(); sgawg.pause(); And then i have to call all the creates of Mediaplayer with a source again. like this:

Javascript & audio in HTML5 - Delay after the first 'play()' call

匆匆过客 提交于 2021-01-28 00:34:40
问题 I have a problem with this very simple HTML5 + Javascript code. It attempts to play a sound directly after it has been loaded. <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Test page</title> </head> <body> <audio src="freedom.wav" id="audio1" preload='auto' onloadeddata="alert('the sound has been loaded !'); document.getElementById('audio1').play();" ></audio> <input type="button" value="Play it again !" onclick="document.getElementById('audio1').play();" /> </body> </html> As

iOS Swift - Poor audio quality when using Bluetooth external speaker

旧街凉风 提交于 2021-01-28 00:18:04
问题 Im using iOS app that stream from url (radio app), once im trying to stream from the app through Bluetooth devise like external speaker or car audio system, the audio quality is vert poor and jarring. When playing from the iOS devise itself, everything sounds good (speaker and earphones). override func viewDidLoad() { super.viewDidLoad() // Set AVFoundation category, required for background audio var error: NSError? var success: Bool do { try AVAudioSession.sharedInstance().setCategory(

Cross fading several audio files using sox

a 夏天 提交于 2021-01-27 21:32:04
问题 I'm trying to cross-fade several audio files together with a 3 second cross-fade and join them together in to one file with sox. I can join several files together by the command below but not sure how to cross fade between each one: sox $(ls /tmp/a*.wav | sort -n) /tmp/out/out.wav I can cross fade two files with the commands below but not sure how to combine the first line that joins several files together with the second line that splices / cross fades sox 100hz.wav 440hz.wav out.wav splice

How to specify a sound card for use with mciSendString API

旧城冷巷雨未停 提交于 2021-01-27 19:42:03
问题 I am updating an old VB6 app. Back in the day, I coded a wrapper around the mciSendString command to be able to record and playback audio. Back then, computers typically had a single audio card. Now, many of the customers have multiple sound cards (typically a built in one and a USB headset). I can't seem to find the API to specify which sound card to use with mciSendString. Can someone point me in the right direction? 回答1: Please check out several solutions here with sourcecode (Ergebnisse

Java - Multi threading sound clips to play at same time

和自甴很熟 提交于 2021-01-27 17:50:48
问题 Problem; Only hearing one sound clip when executed. After one sound has played the other doesn't play & neither can play at the same time. Result; To be able to play 2 sounds at the same time. Code: import java.io.*; import javax.sound.sampled.*; public class ThreadPlay extends Thread { private String filename; // The name of the file to play private boolean finished; // A flag showing that the thread has finished private ThreadPlay(String fname) { filename = fname; finished = false; } public

Playing Multiple Sounds at once Java

◇◆丶佛笑我妖孽 提交于 2021-01-27 17:37:58
问题 I've been trying to play multiple sounds at once within Java for a little bit now, I have no problem with playing 1 sound at a single time, but if I try to play like 3 at a time, it will only play 1 sound (I hope this makes sense) Here is my code: public static void play(String file) { try { clip = AudioSystem.getClip(); clip.open(AudioSystem.getAudioInputStream(new File(file))); clip.start(); while (!clip.isRunning()) Thread.sleep(10); while (clip.isRunning()) Thread.sleep(10); clip.close();

Can we recover audio from MFCC coefficients?

守給你的承諾、 提交于 2021-01-27 14:40:58
问题 Can be get an audio signal back from its MFCC coefficients? Also do MFCC coefficients have a range of value if so what is it and if not how do you normalize it between 0 to 1. I tried using the following MATLAB code: http://labrosa.ee.columbia.edu/matlab/rastamat/ but the recovered audio is no where similar to the original signal. 回答1: This question better fits dsp stackexchange. You can not repair exact signal from MFCC, it drops some information on the way so the signal must be similar but

stop audio while in background

谁都会走 提交于 2021-01-27 14:40:29
问题 There is an app called IHeartRadio which lets you set a sleep timer which will shut off audio after a specified interval. You first choose a station to listen to and then select an amount of time to sleep after which the radio station will stop playing. The app does not need to be in the foreground for this to happen. How is it possible for an app to stop audio while it is in the background? One theory was to set a UILocalNotification with silent audio. Then the UILocalNotification would take