Programmers/coders ...
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

[Closed] Programmers/coders assemble (no pun)

17 Posts
9 Users
0 Reactions
60 Views
Posts: 0
Free Member
Topic starter
 

Is it possible to get a laptop to do the following-

take a signal in from a microphone and produce a tone that lasts the duration of the input signal?

I want to leave it running all day and only make a noise when it gets an input trigger from the microphone.


 
Posted : 30/07/2020 11:32 am
Posts: 8771
Full Member
 

Should be possible yes.

Define audio signal. If someone taps all their fingers very quickly would you want a single tone for the duration of the finger tapping, or individual tones for each tap? What about very quiet signals? Background noise. Just something to think about until someone tells you how to do it.


 
Posted : 30/07/2020 11:42 am
Posts: 4954
Free Member
 

Yes it's possible.


 
Posted : 30/07/2020 11:46 am
Posts: 19
Free Member
 

Do you mean that you want to generate a tone (sound) on the laptop speaker - if you do you could (will) get a problem with feedback


 
Posted : 30/07/2020 11:53 am
Posts: 0
Free Member
 

It is possible, but is it easy?

https://xkcd.com/1425/


 
Posted : 30/07/2020 12:01 pm
Posts: 12865
Free Member
 

@CraigW that is an awful example! Just use OpenCV on the photo. Literally all the work has been done for you!

but @GrahamA is right. You need to be much more specific about what you're trying to do/what problem you're trying to solve.

I bet it could be done in a handful of lines of Python, but I've never done any audio stuff personally!


 
Posted : 30/07/2020 12:11 pm
Posts: 19
Free Member
 

Something like this

https://pypi.org/project/soundmeter/

Might work if the 'input signal' is just a certain level of noise if the input signal is a more complex trigger see CraigW's answer


 
Posted : 30/07/2020 12:11 pm
Posts: 0
Free Member
Topic starter
 

Thanks for replying.

Say an input above a certain noise threshold triggers the output which could, say, be the input sound. I'm basically describing a guitar delay effect, aren't I?

I hadn't considered feedback though, hmm.

edit- anyone know if Audacity can do this sort of live delay effect thing?


 
Posted : 30/07/2020 12:18 pm
Posts: 0
Free Member
Topic starter
 

Looks like Audacity has a 'software playthrough' function which should do the job 😀


 
Posted : 30/07/2020 1:02 pm
Posts: 77347
Free Member
 

However you do this, unless you can somehow filter out the generated tone from the input you will either

a) have to isolate the microphone from the sound you're generating or

b) disable the microphone and play your tone for an arbitrary amount of time.

What's your use case here, what are you trying to achieve? You've brought us your solution rather than a problem. About the only thing I can think of is some sort of neighbourly dogs barking / loud music revenge tool...?


 
Posted : 30/07/2020 1:09 pm
Posts: 8771
Full Member
 

Say an input above a certain noise threshold triggers the output which could, say, be the input sound. I’m basically describing a guitar delay effect, aren’t I?

That example sounds more akin to a gate. A gate will usually have a threshold for the audio level where when the signal reaches that level triggers the gate to open, an attack time to specify speed of ramp from zero to full amplitude, a hold time where it's kept at full volume, then a release time where it fades back to zero again. Adjusting the timing allows you to say make fast repetitive finger tapping to be processed as individual sounds or as a single sound. Usually specified in milliseconds.


 
Posted : 30/07/2020 1:10 pm
Posts: 8771
Full Member
 

Does Audacity come with plugins on Windows? LV2 or LADSPA? Or something else? Long time since I used it.


 
Posted : 30/07/2020 1:13 pm
 Aidy
Posts: 2941
Free Member
 

@CraigW that is an awful example! Just use OpenCV on the photo. Literally all the work has been done for you!

Published 2014-09-24, I'd say the 5 years (with numerous research teams) was up.


 
Posted : 30/07/2020 1:17 pm
Posts: 0
Free Member
Topic starter
 

What’s your use case here, what are you trying to achieve? You’ve brought us your solution rather than a problem. About the only thing I can think of is some sort of neighbourly dogs barking / loud music revenge tool…?

Well, I didn't really want to get into that but there are a couple of very barky dogs over the road and as the owners don't seem to GAS I was going to try training them (the dogs) not bark so much myself, hence the noise-triggered tone. I don't want to blow them away with a sound cannon or anything.

We've asked nicely and (subsequently when things didn't improve) put a noise complaint in to the council but it's still an issue. I'm also fairly concerned for the dogs' wellbeing as they seem to be out in the yard all day. I'm fairly sure it's just boredom on their part (the dogs) but it's still bloody annoying. I don't understand why people get dogs and don't care for them.

Does Audacity come with plugins on Windows? LV2 or LADSPA? Or something else? Long time since I used it.

I don't know, I'm not very familiar with it myself. I've only used it for very basic messing about with guitar and drum machine stuff.


 
Posted : 30/07/2020 1:18 pm
Posts: 12865
Free Member
 

About the only thing I can think of is some sort of neighbourly dogs barking
great guess!! This is a really common question if you google it, loads of potential solutions out there including DIY ultrasonic cannons!

this guy has a youtube channel with a few people claiming success: https://www.youtube.com/channel/UCcA8w_6l3aSsRON_arLkVlA


 
Posted : 30/07/2020 1:51 pm
Posts: 621
Free Member
 

We’ve asked nicely and (subsequently when things didn’t improve) put a noise complaint in to the council but it’s still an issue. I’m also fairly concerned for the dogs’ wellbeing as they seem to be out in the yard all day. I’m fairly sure it’s just boredom on their part (the dogs) but it’s still bloody annoying. I don’t understand why people get dogs and don’t care for them.

That's easier then, play a high pitched tone and filter it out of the input. You could even just record at 22khz instead of 44 so anything over 11khz is filtered out by default.

I'm sure there must be an off the shelf device which would be a lot less effort thoguh


 
Posted : 30/07/2020 2:11 pm
Posts: 77347
Free Member
 

For noise abatement you need to keep a diary for like a month. Did the council ask you to do that?

The RSPCA has some guidance. https://www.rspca.org.uk/utilities/contactus/reportcruelty


 
Posted : 30/07/2020 2:32 pm
Posts: 0
Free Member
Topic starter
 

Yeah, we've done the diary thing but the council appears to be less than useless.


 
Posted : 30/07/2020 2:33 pm

6 DAYS LEFT
We are currently at 95% of our target!