For Programmers: Free Programming Magazines  


Home > Archive > Tcl > November 2007 > Snack: monitoring audio









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Snack: monitoring audio
Ralf Fassel

2007-11-26, 7:22 pm

Windows XP, tcl/tk 8.3.3, Snack 2.2.10.

I'd like to monitor an input audio channel and need to boost it a lot
(make very soft inputs audible). The regular Windows mixer does not
provide enough range, so I need to get the data from the audio device,
scale them by say +60dB and replay them.

Snack does provide in-memory sounds and an 'append data to sound'
method, but as the sound is played, I'd like to remove it from the
sound object in order not to run out of memory (could be continuous
monitoring).

- Is it safe to crop sound data while playing the sound?
- How to determine how much to crop?
- Any other ideas of how to scale the audio input by 60-80dB?

TIA
R'
Ralf Fassel

2007-11-26, 7:22 pm

* Ralf Fassel <ralfixx@gmx.de>
| - Any other ideas of how to scale the audio input by 60-80dB?

Ok, the old rule applies. Post first, then read documentation again,
and find an answer immediately which wasn't there when you first read
the docs.

Sounds like the -channel option could be what I'm looking for...

R'
Alexandre Ferrieux

2007-11-26, 7:22 pm

On Nov 26, 9:57 pm, Ralf Fassel <ralf...@gmx.de> wrote:
> * Ralf Fassel <ralf...@gmx.de>
> | - Any other ideas of how to scale the audio input by 60-80dB?
>
> Ok, the old rule applies. Post first, then read documentation again,
> and find an answer immediately which wasn't there when you first read
> the docs.
>
> Sounds like the -channel option could be what I'm looking for...


This will get you the plumbing, but no magic.
If the signal is so weak, most likely the SNR will be poor.
Linearly amplifying will change nothing.
No way of enabling the "Microphone boost" or plugging a preamp ?

-Alex
billposer@alum.mit.edu

2007-11-26, 7:22 pm

On Nov 26, 12:57 pm, Ralf Fassel <ralf...@gmx.de> wrote:
> Ok, the old rule applies. Post first, then read documentation again,
> and find an answer immediately which wasn't there when you first read
> the docs.
>
> Sounds like the -channel option could be what I'm looking for...
>
> R'


I'm not clear as to how the channel option is going to help. That's
for selecting left vs. right, or in some commands, mono vs. stereo.

One possibility would be to use two sounds. Read into one, scale it
and play it. While it plays, null out the other, read into it, and
scale it. Play it when the first one is done.
Ralf Fassel

2007-11-27, 4:33 am

* Alexandre Ferrieux <alexandre.ferrieux@gmail.com>
| > Sounds like the -channel option could be what I'm looking for...
|
| This will get you the plumbing, but no magic.

This is what I need...

| If the signal is so weak, most likely the SNR will be poor.

Nope, the signal source is a digital microphone with >120dB input
range, so the SNR is ok.

However, while on Linux the -channel option works ok, on Windows it
does not work reliably. Sometimes it does not play at all and hangs
immediately, sometimes it stops working after the second or third
reconnection (the app is completely blocked). Will have to dig into
the snack sources for the reason and how to avoid the cause...

R'
Ralf Fassel

2007-11-27, 4:34 am

* billposer@alum.mit.edu
| > Sounds like the -channel option could be what I'm looking for...
|
| I'm not clear as to how the channel option is going to help. That's
| for selecting left vs. right, or in some commands, mono vs. stereo.

Nope, that's -channels (note the trailing 's' :-)

| One possibility would be to use two sounds. Read into one, scale it
| and play it. While it plays, null out the other, read into it, and
| scale it. Play it when the first one is done.

If I don't get -channels working, maybe I'll go this way. However,
I'd like to avoid any clicks when switching the sounds. Windows will
probably find a way to break this one, too. :-(

R'
Ralf Fassel

2007-11-27, 7:23 pm

* Ralf Fassel <ralfixx@gmx.de>
| However, while on Linux the -channel option works ok, on Windows it
| does not work reliably. Sometimes it does not play at all and hangs
| immediately, sometimes it stops working after the second or third
| reconnection (the app is completely blocked).

Ok, classical deadlock in my process when reading slow and fast
(audio) data simultaneously in the same process. If I delegate the
audio playback to a separate process, it seems to work [TM].

Thanks for the input...
R'
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com