Windows CE 5.0 Sound Issue - c#

I have an asp.net application that runs on an MC9090 scan gun running Windows CE 5.0. I'm trying to play a sound on the scanner through the website. I used the code below to play the sound on the scanner, but it sounds like a crackle instead of the sound.
<embed id ="MyAudio" src="/External/MySound.mp3" type="audio/mpeg" autostart="true" loop="false" />
Doing my research I found out that even when I play sounds directly on the scan gun, it doesn't play the sound instead it just plays the short crackle sound. So I thought the speakers were not working, but all the system sounds work fine. scan beeps and error beeps.
This is happening on two different scan guns. Does anyone have any ideas why even when I click on a wav file in the explorer on the scan gun it still doesn't play the sound correctly. Any help would be great.
EDIT: Also to clarify the system sounds are working on the scanner but nothing plays when called in the website, example:
System.Media.SystemSounds.Asterisk.Play();

Not all 9090s have working sound cards. Some need to have their core updated, which would involve contacting Motorola. You will still hear the scan and error beeps because all the 9090 devices have a built in beeper, that will take over if the speaker is not functioning properly.
The best way to test this would be to use OTL:
Go to the Application directory and launch OTL.exe
Click the "Test Apps" option.
Click the 'SelfTest" option.
Select "Speaker" and then click the "Start" button.
Select any wav file from the drop down and then listen. If it fails, you will see an error on the bottom of the form. Even on an error, you should still hear something because the device will attempt to use the Beeper instead.
If you don't have OTL, you could attempt to compare the wav files with another device that is known to have working sound.
If it is in fact an issue with the Speaker, you should contact Zebra because the device needs an update.
Also, to my understanding, the procedure you are calling will only attempt to play the wav file and not use the Beeper on failure. Which would cause the error of no sound to be played.

Related

Unity iOS Build - No audio when returning from Control Center with external audio playing

I have a Unity iOS app with Mute Other Audio Sources checked in Project Settings > Player. When I'm playing audio from another app on device and foreground my app, everything works as expected: the audio from the other app fades out and the audio from my app fades in.
However, when I have my app open and audio is playing, open up the iOS Control Center, start playing audio from another app (say, Apple Music, Apple Podcasts, or Spotify), and then close the control center, unexpected behavior occurs. The audio from the other app fades out as anticipated, but the audio from my app does not fade back in. All audio in my app remains muted/disabled/otherwise silenced as I continue playing, and only returns when I background and foreground my app again.
I have also received a user report that the app crashed when repeating these same steps (open Control Center, play music, close Control Center). I haven't been able to reproduce that bug, but I am concerned that this may be an issue for other users.
It's almost as if different audio behavior occurs in OnApplicationPause vs. OnApplicationFocus, but I haven't been able to get it to work even if I restart my AudioSource in either of these contexts.
I have reproduced this error in Unity 2019.4.17 and 2020.3.18. Not sure if it's a bug in Unity or if there's something I could be doing in my code to mitigate it. Let me know if I can provide additional information that would be helpful in addressing the issue. Thanks in advance for any advice you're able to give!
Update: Using Unity 2020.3.18 and iPhone 13, this only happens when the iOS device is on silent mode. The app normally plays audio even if the device is silenced, but fails to play audio if the device is silenced and I return to the app from the Control Center as described above. When I experience this issue, the audio plays after switching to ring mode. When the device is on ring mode from the start, everything works as expected.

Windows 8: How to loop audio in Toast Notifications?

While experimenting with Toast Notifications, I have run into an annoying little problem. If I attempt to set the audio to looping, the notification will not play any sound at all. Using non looped sound will work just fine. I am using the code from the MSDN site like so:
...
IXmlNode toastNode = toastDoc.SelectSingleNode("/toast");
((XmlElement)toastNode).SetAttribute("duration", "long");
XmlElement audio = toastDoc.CreateElement("audio");
audio.SetAttribute("src", "ms-winsoundevent:Notification.Looping.Alarm2");
audio.SetAttribute("loop", "true");
toastNode.AppendChild(audio);
...
And it simply will not play sound if I set the 'loop' attribute to true. I have tried manually setting 'silent' to 'false' as well as picking from different sound options listed here: http://msdn.microsoft.com/en-us/library/windows/apps/hh761492.aspx
I have confirmed that the toast are lasting for 25 seconds (as specified by the long duration) and I have tried reordering the audio attributes, all to no avail. Can anyone tell me what the heck is going on here?
So it turns out that the toast audio is working just fine. The actual problem is admittedly odd. After digging around a lot, I found that the alarm / call / files that get used in the loops are all silent on my machine, i.e. they have no audio in them. This seemed really weird since they came from the OS installer. After more investigation, I found that each of my machines (I have two) that have an N Edition of Windows 8 installed has these silent files. My other machines, which have the normal editions have files that actually produce audio. So far I have solved the problem by changing the permissions to the "c:\windows\media" directory (something I don't like doing) and copying the real files over by hand. I plan on submitting a report to Connect, and I will post new material if I discover a less painful way to fix the issue.
UPDATE:
Installing the Media Features Pack from MS will fix the issue. The Alarm*.wav and Call*.wav audio files in C:\windows\media will have audible content. This kind of bites in my opinion because I didn't install media player for a reason, and now my N-Edition customers may experience what seems to be a bug.

Implementing playlists with songs from phone storage [windows phone]

I have been struggling with an issue with my media player windows phone (7) application. The problem is that I can't seem to implement playlists.
What I want to do is play songs from the media library. This article seems pointless.
I've tried getting into the SongCollection class and figure out how to create more of these things. It appears to be impossible (no constructor, can't cast it, can't inherit it).
After that I tried getting an object on the process running the background audio agent that existed in my app (until I discovered it was redundant), and feed the media player one song at a time.
Problem is, I don't know when the media player stopped playing. It works ok as long as my app is in the foreground, but when it is not, everything stops working, only the media player keeps going.
Is there a way I haven't figured out? In the article above they suggest there is a link between the Zune Media Queue, which I presume is the MediaPlayer.Queue property, and various things I can implement, but I just can't figure a way to make it go.
You should give up since building your own media player is an impossible mission (been there, done that). You cannot create playlists or edit any information, you cannot replace default event handlers for on-screen music controls, you don't get events for music change in your application unless it is currently running.
Basically, it is really limited in what you can do right now and the situation isn't much better with WP8.
I hope that it will be less read-only by the time we get Windows Phone 9.
Take a look at the UWP samples from Microsoft:
https://github.com/Microsoft/Windows-universal-samples
The sample contains play/pause/playlists explanation.
This was already possible in Windows phone 7.5/8/8.1

Check what programs are playing audio?

I am making a program and I want to find and mute programs that are playing audio so all you hear is mine.
(This is an option for the program, nothing malicious about it)
I have looked it up and I cannot seem to find a way to check what programs are playing audio (Much like windows does)
I don't have any code examples of attempting this because id has no idea.
In case someone misses reads or I don't word the above sentences correct I would like to find EVERY process with audio playing and either KILL or MUTE the process
If you can get Peak meters for individual programs on Windows 7, you can identify sessions and applications. IAudioSessionControl interface offers you muting options similar to what user can do via standard Volume Mixer application (session muting in particular).
There was a pretty similar question, maybe the same approach I posted in my answer would fit your scenario: https://stackoverflow.com/a/14828598/674700. What you'd need to change are the types of files (into .mp3, .wav and so on) and kill the processes found, with the exception of your application's.
The drawbacks: you'll need to run your application as administrator and it also requires a third party console app.

Audio capturing in C#

I have a MAYA 44 USB sound card and would like to interface it with C#. I want to record from the provided microphones and produce a data array.
I have found examples when using the internal sound card from my laptop but when it comes to external it does not quite work.
Has anyone every connected the above sound card with C# please?
Have you had a look at the DirectSound API (Windows only though, I think). Might provide what you're after.
On how to record audio with C# in general there are already multiple threads on SO, so I won't talk about that.
I see two possible causes for your program which have different solutions:
You need to change which audio sources are muted in the windows volume control ("sndvol32.exe /R")
When opening the audio device there are multiple devices. And you're simply opening device 0 instead of enumerating them and perhaps choosing another one. The external sound-card might appear as a second device.

Categories

Resources