Yes, me again. I'm trying to develop an app that will allow my students (I teach Phonetics) to listen to their own pronunciation in real-time (it's not as silly as it sounds; we don't hear our own voice the way it really is). I have encountered two problems, 1) there is some delay (small, but big enough to bother) between the input and the output, 2) I get a lot of distorsion. As for the latter, I've tried using [clip~] but it didn't really solve the problem. Keep in mind I have used the same microphone (headset) to record on the phone and I get no distorsion at all. Any thoughts?
-
Self-listening app
-
@MDobleZ Pd will give you 1.45ms of additional latency at its standard 64 sample block size.
But the round trip os latency will depend on the phone and its settings. Google finds some fixes for phone latency but they cannot be universally applied....... and your students will have to apply them to their phones.
Distortion is obviously not normal. But if you set the audio buffer too low..... so as to reduce latency.... you might have introduced distortion.
Even an app like this....... https://play.google.com/store/apps/details?id=com.google.android.accessibility.soundamplifier&hl=en&showAllReviews=true presumably written in Java, will probably have too much latency (there are complaints in the reviews).
David. -
there is some delay (small, but big enough to bother) between the input and the output,
There is always delay in computer audio systems. The only solution is to reduce the audio hardware driver buffer size, which must be done outside of Pd.
Distortion: If the mic input is too hot, then the audio will be distorted in the soundcard. There's nothing any software can do to fix that. I can say categorically that Pd will do nothing to distort an in-range signal coming in, unless you ask it to... so if you're just passing input to output and getting distortion, then it's likely that the input is distorted.
Unfortunately the exact solution will depend on the type of mic being used and how it's connected. If it's a cheap headset mic or phone earpiece connected to the built-in 1/8" jack, you might try the system control panel and look for a mic level setting.
hjh
PS Edit: Didn't see the previous reply!
-
I get the type of distorsion you get when you either speak too close to the microphone or when there's a damaged cone; sort of a buzz.
-
@MDobleZ If its Android I think the sample rate is 48K...... the first thing to check for Pd.
Do you get distortion even when whispering?
David. -
I get the same problem when running the patch in PD.
-
@MDobleZ If the range of your volume sliders are set for 0 to 1 then I can't see a problem.
Maybe upload the patch to this thread so that we can check it.
David. -
Thanks for the disposition. Here it goes:
belting10.pd -
@MDobleZ Hmm...... no distortion for me unless I reduce the "Delay (msecs)" too low in Pd's Audio Settings. I run mine at "80" for everyday work. I can get that down to "3" using a professional soundcard.
Make sure you are not sending a value of more than "1" to [r vol1] though.
David. -
i can confirm what @whale-av stated, no distortion here too (cheap internal realtek laptop chipset via ALSA at 8 msec delay, which seem reasonable to me in regard of non musical timing requirements). sorry, i doubt, i can't help...
-
Maybe I'm pushing the mic too much. This is a smaple of what I hear: dist.wav
-
@MDobleZ ahh, definitely yessss! did you have a look at the sample in a wave editor? this clips as hell!
-
Once again -- probably the distortion is coming from outside of Pd.
The signal flow is like this:
-
The mic converts air pressure variations into an analog electrical signal.
-
A pre-amplifier in the soundcard adjusts the volume in the analog domain.
-
The ADC converts the analog signal to digital.
-
The OS pipes the digital signal to Pd.
My guess is that the signal is too loud at #2. If so, then the ADC (#3) will produce a distorted (clipped) signal. After this -- understand this clearly -- there is nothing you can do in the digital domain to fix it.
It's critical to be sure the recording volume in the soundcard is set correctly. The recording volume must be adjusted before sampling. Pd gets the audio after sampling, so your patch can't do anything about it.
I'd actually said this a week ago but, glancing over the thread, nowhere does anybody say "I set the mic level." So I think probably you haven't done it... but this is the first thing to check when a mic is distorting.
If it's a built-in soundcard, the volume will be a system setting. If it's an external soundcard, it will be a knob on the external unit.
hjh
-
-
Thanks, toxonic and ddw_music, I'll take a look at that.
-
Thank you very much. The problem was (as you correctly guessed) the soundcard mic settings. Now I have to take the time to explore this in Android.
Thanks again.