Open sparkstrike opened 1 year ago
Could you explain in a bit more detail in which case it returns zeros of the right shape immediately? This is not supposed to happen.
I seem to have the same problem when using the microphone to record on Mac.
default_mic = sc.default_microphone()
samplerate = 48000
seconds = 20
data = default_mic.record(samplerate=samplerate, numframes=samplerate*20)
print(data,len(data),max(data))
[<Microphone MacBook Pro Microphone (1 channels)>, <Microphone Microsoft Teams Audio (2 channels)>, <Microphone WebexMediaAudioDevice (2 channels)>]
0: MacBook Pro Microphone
1: Microsoft Teams Audio
2: WebexMediaAudioDevice
[[-0.]
[-0.]
[-0.]
...
[-0.]
[-0.]
[-0.]] 960000 [-0.]
@wolfiex this does not seem related to loopback recording, so this is a different problem. Please open a new issue.
@bastibe This issue may be the same as #166 , because I saw same output when I opened that issue. Using the latest master branch may resolve this issue.
@sparkstrike Could you try using the latest version of master branch instead of the released version?
First of all, thanks so much for your work on it! I tried to record audio from speaker, it return a array with correct shape, but all element is zero: [[0, 0], [0, 0], ...], and the data return immediately (not 5 second) . It is strange that it works well yesterday and record by pc's physical microphone (not loopback).
environment PC: DELL G3 notebook computer; OS: win11; python3.7 and SoundCard v0.4.2
The other strangenesss is that it return valid audio array when play a music, but return [0] array when a few seconds after the music stops playing. The gif show it. (The
RECORD_SEC
change to 2 second)