Need help with triggering audio (newcomer and lost)

maltevelin's icon

Hey people!

I need to make a program that triggers a random soundfile (from a list of several files) whenever the computers microphone "hears" anything.

So far i can only make MAX play what the computer "hears".

I cant find any answers through searching but something tells me this is quite simple to do.

Sorry for the inconvenience, i hope someone is able to help

Kind Regards

M

corbi14's icon

Have you tried ezadc for mic input? or adc~ ?
a problem ive recently overcome too.
fellow rookie!

vektoren's icon

You mean to choose a random file after a "audio trigger" over your mic? But you don't want to recognize the speech (like Siri on iPhone 4S), right? So lets say anybody claps in the hands - the next random file is playing etc.?

maltevelin's icon

Yeah i use ezadc - and it picks up the mic. The problem is however that i cant make the input trigger a soundfile - i can only make it play the input back in the headphones. Thanks for the quick reply

maltevelin's icon

Vektoren:

Thats exactly what i want to do :) audio trigger that plays when someone speaks or clap their hands etc.

vektoren's icon

Here is a solution. But I can't remeber how to convert a signal to bang. This is a TODO in that patch. But you can see the "1" inside the number~ object if you clap. Maybe you have to change the numbers a little bit for your mic. With my Mac Book Pro it works perfect.

Max Patch
Copy patch and select New From Clipboard in Max.

I'm sure that the convert-thing into bang is very simple, but can't remeber...

vektoren's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Now it works! The right outlet of number~ provides the float value, so compare that with 1 and done :-)

maltevelin's icon

Thanks this is very neat... my only problem now is how to make it actually play a sound. I see that it recieves my the input but nothing is playing and i dno how ... sorry im so green to this

maltevelin's icon
keithmanlove's icon

What are you using to play the sound files? Figure out what that needs and what your result from the earlier patch is and try to bridge the gap.