audio

PyAudio callback function called only once

久未见 提交于 2021-01-07 03:04:56
问题 I'm trying to use PyAudio to simply reproduce a wav file using the non-blocking IO code available here: PyAudio documentation. Differently from the documentation, I'm trying to use numpy input data instead of bytes, so i'm using librosa to load my .wav file instead of wave as shown in the documentation. My code is the following one, it's self contained and reproducible, you just have to change the filename with the one of a wave audio you want to reproduce: import pyaudio import wave import

Using Python to playback mic input to PC in real-time

泄露秘密 提交于 2021-01-07 02:48:02
问题 I'm trying to use Python to 'mic-monitor', i.e., to playback the mic signal through the headphones in real-time, in addition to any other output signal from the PC. I can accomplish this by amending my PC's playback settings, but I want to do it with Python, so that I can program a Raspberry Pi to mic-monitor my cheap headset for the PS4. I can almost accomplish this with PyAudio or sounddevice, but there is a small but significant delay. So: Is there a way to eradicate that latency with

Using Python to playback mic input to PC in real-time

邮差的信 提交于 2021-01-07 02:46:28
问题 I'm trying to use Python to 'mic-monitor', i.e., to playback the mic signal through the headphones in real-time, in addition to any other output signal from the PC. I can accomplish this by amending my PC's playback settings, but I want to do it with Python, so that I can program a Raspberry Pi to mic-monitor my cheap headset for the PS4. I can almost accomplish this with PyAudio or sounddevice, but there is a small but significant delay. So: Is there a way to eradicate that latency with

How to make implementation of IStream correctly (MediaFoundation)?

。_饼干妹妹 提交于 2021-01-07 02:34:47
问题 The bounty expires in 6 days . Answers to this question are eligible for a +50 reputation bounty. Aleksey Timoshchenko is looking for an answer from a reputable source . General idea is to get a IMFSinkWriter that will write a data to the buffer. There is such an implementation bool co_AudioEncoderMF::start_encoding_to() { bool result = false; co_Stream stream; IMFByteStream * byte_stream = nullptr; IMFMediaSink * media_sink = nullptr; IMFSinkWriter * sink_writer = nullptr; HRESULT hr =

How to make implementation of IStream correctly (MediaFoundation)?

你。 提交于 2021-01-07 02:34:25
问题 The bounty expires in 6 days . Answers to this question are eligible for a +50 reputation bounty. Aleksey Timoshchenko is looking for an answer from a reputable source . General idea is to get a IMFSinkWriter that will write a data to the buffer. There is such an implementation bool co_AudioEncoderMF::start_encoding_to() { bool result = false; co_Stream stream; IMFByteStream * byte_stream = nullptr; IMFMediaSink * media_sink = nullptr; IMFSinkWriter * sink_writer = nullptr; HRESULT hr =

How to receive “icecast” internet radio stream for immediate playback with Python?

回眸只為那壹抹淺笑 提交于 2021-01-07 02:16:12
问题 I'm wanting to take an internet audio/radio stream (specifically Longplayer, click for direct stream URL) and play it with python. It's preferable that it's backgrounded, such that the script able to continue running its main loop. (e.g. as game background music or something, though Pyglet, PyGame et al. may provide their own tools for that.) I've seen some likely out of date examples of recording internet radio using requests and dumping it into a file but this isn't exactly what I want and

How to receive “icecast” internet radio stream for immediate playback with Python?

混江龙づ霸主 提交于 2021-01-07 02:15:43
问题 I'm wanting to take an internet audio/radio stream (specifically Longplayer, click for direct stream URL) and play it with python. It's preferable that it's backgrounded, such that the script able to continue running its main loop. (e.g. as game background music or something, though Pyglet, PyGame et al. may provide their own tools for that.) I've seen some likely out of date examples of recording internet radio using requests and dumping it into a file but this isn't exactly what I want and

How to receive “icecast” internet radio stream for immediate playback with Python?

你离开我真会死。 提交于 2021-01-07 02:14:56
问题 I'm wanting to take an internet audio/radio stream (specifically Longplayer, click for direct stream URL) and play it with python. It's preferable that it's backgrounded, such that the script able to continue running its main loop. (e.g. as game background music or something, though Pyglet, PyGame et al. may provide their own tools for that.) I've seen some likely out of date examples of recording internet radio using requests and dumping it into a file but this isn't exactly what I want and

How to receive “icecast” internet radio stream for immediate playback with Python?

久未见 提交于 2021-01-07 02:13:59
问题 I'm wanting to take an internet audio/radio stream (specifically Longplayer, click for direct stream URL) and play it with python. It's preferable that it's backgrounded, such that the script able to continue running its main loop. (e.g. as game background music or something, though Pyglet, PyGame et al. may provide their own tools for that.) I've seen some likely out of date examples of recording internet radio using requests and dumping it into a file but this isn't exactly what I want and

How to receive “icecast” internet radio stream for immediate playback with Python?

南楼画角 提交于 2021-01-07 02:13:00
问题 I'm wanting to take an internet audio/radio stream (specifically Longplayer, click for direct stream URL) and play it with python. It's preferable that it's backgrounded, such that the script able to continue running its main loop. (e.g. as game background music or something, though Pyglet, PyGame et al. may provide their own tools for that.) I've seen some likely out of date examples of recording internet radio using requests and dumping it into a file but this isn't exactly what I want and