audio

Android - How do I only allow one instance of MediaPlayer to play at a time?

早过忘川 提交于 2020-12-05 12:20:48
问题 I'm trying to create a simple Sound-board Android app, using ListView items as buttons. (Btw, I'm a novice programmer) The idea is that I press a button, and a specific sound file plays. If I press any button while a sound is playing, it should first stop that sound and then start to play the new one. Currently the sounds play without stopping any currently playing sounds, so that if I spam the buttons I get multiple sounds playing at the same time (and if I press too many at once, the app

Play 2 different audio streams on left and right speaker

孤者浪人 提交于 2020-12-02 07:21:43
问题 Some special circumstances force me to do that perverted thing. Is it possible to play 2 different audio streams on different channels. Imagine a headset and I need to play 1st song at left speaker and 2nd song on right speaker simultaneously. After some research I found that it is possible to play at some single channel. Its possible even to close one of them. But I didn't find any information how to play 2 audio streams simultaneously. Is it even possible? And how? Some code examples and

How do I go from sound to spectrum then back to sound in python?

落花浮王杯 提交于 2020-12-01 12:29:04
问题 How do I take a wav file, transform it into an array of frequency intensities every couple ms, do something with that array then transform that new array back into a wav file. Is there a library that looks something like this wav_data = library.read_wav('aoeu.wav') # [0, 3, 201, ... etc] spectrum = library.get_spectrum(wav_data) # [[0, 0, 0, .2, 0, .7, ... etc], # [0, 0, 0, .3, 0, .8, ... etc], # ... etc] spectrum[:, 0] = 0 # kill the lowest frequency (assuming spectrum is a numpy array)

How do I go from sound to spectrum then back to sound in python?

此生再无相见时 提交于 2020-12-01 12:24:23
问题 How do I take a wav file, transform it into an array of frequency intensities every couple ms, do something with that array then transform that new array back into a wav file. Is there a library that looks something like this wav_data = library.read_wav('aoeu.wav') # [0, 3, 201, ... etc] spectrum = library.get_spectrum(wav_data) # [[0, 0, 0, .2, 0, .7, ... etc], # [0, 0, 0, .3, 0, .8, ... etc], # ... etc] spectrum[:, 0] = 0 # kill the lowest frequency (assuming spectrum is a numpy array)

How do I go from sound to spectrum then back to sound in python?

冷暖自知 提交于 2020-12-01 12:23:18
问题 How do I take a wav file, transform it into an array of frequency intensities every couple ms, do something with that array then transform that new array back into a wav file. Is there a library that looks something like this wav_data = library.read_wav('aoeu.wav') # [0, 3, 201, ... etc] spectrum = library.get_spectrum(wav_data) # [[0, 0, 0, .2, 0, .7, ... etc], # [0, 0, 0, .3, 0, .8, ... etc], # ... etc] spectrum[:, 0] = 0 # kill the lowest frequency (assuming spectrum is a numpy array)

python converting video to audio

假装没事ソ 提交于 2020-12-01 10:44:29
问题 We are working on a project to convert video to audio, and this is the sample code: from converter import Converter from moviepy.editor import * c = Converter() clipv = 'g.mp4' clipc = VideoFileClip(clipv).subclip(0,20) conv = c.convert(clipc, 'clip5.mp3', {'format':'mp3','audio':{'codec': 'mp3','bitrate':'22050','channels':1}}) for timecode in conv: pass However, it gives me this error Traceback (most recent call last) File "del.py", line 7, in <module> for timecode in conv: File "/usr/local

python converting video to audio

荒凉一梦 提交于 2020-12-01 10:44:19
问题 We are working on a project to convert video to audio, and this is the sample code: from converter import Converter from moviepy.editor import * c = Converter() clipv = 'g.mp4' clipc = VideoFileClip(clipv).subclip(0,20) conv = c.convert(clipc, 'clip5.mp3', {'format':'mp3','audio':{'codec': 'mp3','bitrate':'22050','channels':1}}) for timecode in conv: pass However, it gives me this error Traceback (most recent call last) File "del.py", line 7, in <module> for timecode in conv: File "/usr/local

Is there anyway to visualize youtube audio from an iframe using the web audio api?

試著忘記壹切 提交于 2020-11-30 12:53:36
问题 Is it possible to listen to the audio of a youtube video that is in an iframe and then analyse it for use in a web audio api based visualizer? From the way my site is made, I can only get the source url from an iframe. Here is an example of one of my iframes: <iframe id="youtube-player" type="text/html" width="500" height="281" src="https://www.youtube.com/embed/JlhTiynRiXA?feature=oembed" frameborder="0" allowfullscreen></iframe> 回答1: Hope this helps any future Googlers. The only way I've

Is there anyway to visualize youtube audio from an iframe using the web audio api?

六眼飞鱼酱① 提交于 2020-11-30 12:52:51
问题 Is it possible to listen to the audio of a youtube video that is in an iframe and then analyse it for use in a web audio api based visualizer? From the way my site is made, I can only get the source url from an iframe. Here is an example of one of my iframes: <iframe id="youtube-player" type="text/html" width="500" height="281" src="https://www.youtube.com/embed/JlhTiynRiXA?feature=oembed" frameborder="0" allowfullscreen></iframe> 回答1: Hope this helps any future Googlers. The only way I've

Is there anyway to visualize youtube audio from an iframe using the web audio api?

风流意气都作罢 提交于 2020-11-30 12:52:21
问题 Is it possible to listen to the audio of a youtube video that is in an iframe and then analyse it for use in a web audio api based visualizer? From the way my site is made, I can only get the source url from an iframe. Here is an example of one of my iframes: <iframe id="youtube-player" type="text/html" width="500" height="281" src="https://www.youtube.com/embed/JlhTiynRiXA?feature=oembed" frameborder="0" allowfullscreen></iframe> 回答1: Hope this helps any future Googlers. The only way I've