Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is not showing my live speech wave form #5

Open
lio14cha opened this issue Sep 12, 2018 · 7 comments
Open

It is not showing my live speech wave form #5

lio14cha opened this issue Sep 12, 2018 · 7 comments

Comments

@lio14cha
Copy link

whenever I ran the code it is showing continuous wave forms without having any input.After connecting michrophone also it is giving the same waveforms always(oscillations). How can I make it take my live speech and show it as wave form.
Thanking you

@rudrathegreat
Copy link

rudrathegreat commented Oct 27, 2018

What is the actual issue?

@Nukul13
Copy link

Nukul13 commented May 7, 2020

I am also facing the same issue. Waveforms are shown on the screen but they are not the waveforms of live audio stream from the microphone, they are just random noise. Giving any input from microphone does not make any difference in the waveform on the screen.

@rudrathegreat
Copy link

I seem to have fixed the issue. You have to setup the microphone, I believe that's what you do, I'll upload my version of the code which works when you have a mic setup.

@Nukul13
Copy link

Nukul13 commented May 8, 2020

What do you mean by mic setup exactly? I have used mic with pyaudio before and it worked just fine. But here it is not able to properly visualize the waveform so I think some changes in the visualization part of the code is required. One of the main issue is the waveform is choppy. It does not show the continuous form the waveform properly. I have tried changing mic as well but still the waveforms are not proper.
Screenshot from 2020-05-08 08-41-48
mic 1

Screenshot from 2020-05-08 08-53-52
mic2

@Nukul13
Copy link

Nukul13 commented May 8, 2020

I was able to find the workaround for this issue. As mentioned in #2 , instead of using 2 step conversion from audio data to numpy array I used the single step converstion along with the offset of 128. But in addition to that I scaled the the whole array with the max value so that waveform can be visualized within range.
data_np = (np.frombuffer(data, dtype='<i2') / max(data)) + 128

NOTE: Also make sure that the input volume of microphone is high enough to capture the audio signal.

@putmanj00
Copy link

I don't know if this will work for y'all, but I stumbled across this stack overflow article, and the fix there resolved this issue for me: https://stackoverflow.com/questions/62656790/input-overflowed

data = stream.read(CHUNK,exception_on_overflow = False)

@rudrathegreat
Copy link

sorry haven't used this code in ages. But from what i remember, "setup the mic" means setting the microphone you're using as the default microphone such that pyaudio recognises this mic and automatically gathers audio data from the mic your using. This is something you have to do in your OS settings and it's got nothing to do with pyaudio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants