Why does my WASAPI listener fire even when nothing is playing? - naudio

WASAPI is documented as not sending audio data if nothing is playing any sound, e.g. this note about WASAPI in NAudio:
Now there is one gotcha with WasapiLoopbackCapture. If no audio is playing whatsoever, then the DataAvailable event won't fire. So if you want to record "silence", one simple trick is to simply use an NAudio playback device to play silence through that device for the duration of time you're recording. Alternatively, you could insert silence yourself when you detect gaps in the incoming audio.
I have written a WASAPI listener, but on my machine, it always fires even when nothing is making any sound. Other users indeed report that when nothing is playing, the signal stops.
So I think some process must be making Windows think that something is playing on my machine, but I can't figure out what it is.
How can I find the source of this phantom audio?

This isn't much of an answer, but when I rebooted, the issue went away. I am assuming that some application like Spotify was playing something, even though it wasn't audible.

Related

Transmit Audio Via Micro:bit Radio In MicroBlocks

I am using a BBC Micro:bit version 2 and have a program set up on an editor called Micro:blocks. The code is supposed to take input from the first micro:bit's microphone and play it out of the other one's speaker. But when I try it, all I get is an annoying buzzing noise coming out the other end.
I can play it correctly out of the first micro:bit only (not using radio) and it sounds fine. I can't figure out why the second micro:bit makes a buzzing noise.
With the program without radio, I messed around with how long before it played the noise, and none of the tests resulted in a buzzing noise, so I know it's probably not a timing or delay issue.
Anyways, here is my code.
Transmitting code:
when [button a] pressed
set radio group to (7)
set radio channel to (7)
set radio transmit power to (7)
digital pin write (on) to (28)
forever
analog pin write (microphone + 500) to (0)
radio transmit number (microphone + 500)
when [button b] pressed
stop other processes
radio transmit number (0)
analog pin write (0) to (0)
receiving code:
when program started
forever
if (new radio message)
analog pin write (0) to (radio last received number)
This is an interesting project!
Your program looks correct but the radio system may not be fast enough to send each sound sample as a separate message. As a result, you are just hearing a series of clicks, resulting in the buzzing noise.
You could check that the sound data is being sent and received by sending a second or two of sound and graphing the incoming samples on the receiving side. It will be slow, but you should see something that looks like a smooth audio waveform.
Assuming speed is the issue, you could try sending several samples in each packet by encoding them into a string. But even that may not be fast enough to create a smooth audio stream, especially since the encode/decode process will take time.
A different approach would be for the receiver to collect a second or two of sound samples in a list, then play them back in a burst. That would not provide continuous audio but might allow transmitting a sentence at a time.
Here is a record/playback project you might use as a starting point for experimentation.
Note that you can download this image and drop the .png file into the MicroBlocks IDE. MicroBlocks will read the project back from the image itself :)

How do I delay video from my webcam on my own feed?

Id like to have the ability to delay the video from my webcam on. my own computer. Honestly I am using. it. as a "delayed mirror" for my golf swing. I have always recorded, then stopped, opened up the file and watched then did it again. Doing this 30 times in a session working on my swing is annoying. Id like to just take a webcam, be able to delay the video 5,8,10 seconds so I can watch and just keep moving. what is the easiest way around this. I have been told I could do this with a script but not sure where to start. Can anyone help me or send me in the right direction? Im on a Mac but also have a PC if needed.
Python + OpenCV.
First manage to show a current image from your webcam using tutorials.
Then instead of immediately showing the image you add it at the end of a buffer object, this could be a collections.deque from standard Python.
If you want to delay for say 5 seconds and you're capturing with 30 frames per second, then don't show anything until you add 5*30 images from your camera to the buffer. Now when you filled the buffer as soon as you get another image, you add it to the end of the buffer, but also remove 1 image from the beginning of the buffer and show it.

AppleScript to access system Now Playing, without iTunes

I'd like to have a script that does something every time the current playback changes, i.e. something different is displayed in the Now Playing widget in Notification Centre. All the solutions I found involved telling iTunes to give AppleScript the information, however, my script shouldn't work solely with playback from iTunes, but primarily Safari (SoundCloud web). Any way Now Playing data is accessible using AppleScript, independent of iTunes?

aurioTouch not playing back

I just downloaded and tried this one on the iPad. The mic is working since I can see the graphics displayed in response to voices. But there was no playback from the speaker. Yes, I have tried both mute button on and off. Any hint as to what happened?
I seem to remember there is some problem with pass-thru in that application, when I looked at it a few months back.
Try removing the DC filter.
I think it is a horrible piece of code, so forgive me for not digging into it.
I can't remember if it is just a simulator bug or whether it also hits the device.

how to cancel incoming message sound on Symbian PyS60

I am writing a parental control app using PyS60 ( on Nokia E72)
The app is operated via sms's.
Every sms that operates the app is deleted when entering the inbox listener's callback, and by using a blank audio file, I manage to cancel the "new message" sound alert.
However,
this only works when the focus in on Python Script Shell.
Meanning - when I switch to desktop, or any other app that is open, the new message alert sound is playing.
My guess is - I'm losing the race with the messaging module (or process race condition),
Does anyone know how to make this work while running in background?
Or even cancel the process that handles incoming sms's and deal with it myself?
Or lower the priority of the process ??
any other suggestions are also welcome..
thank in advance,
Amitos80