• 0

Question

Hey gang,

I have a media application (Bedia, free available here: http://www.blissgig.com/display.aspx?id=13 ) that I have added speech recognition. The problem is that on some lower end systems the SR causes the audio playback to become "off" from the video playback, usually by only a fraction of a second. I am using WMP as the audio/video playback.

The question is, I am thinking of having a threaded class that does the monitoring for the speech recognition, but before I go down that path I thought I'd ask for any thoughts? Is there anything I should be aware of or......

I know the question is a bit vague, I am attempting to avoid mentioning specifics so that any and all issues for this process are brought up.

Thank for your time.

9 answers to this question

Recommended Posts

  • 0

If I understand well, you're currently handing the audio data to a speech recognition API before handing it to WMP, which can cause the audio to become out of sync? It's pretty strange that this is happening, but I'm not familiar with WMP.

In any case, doing this on separate thread would work as long as you're actually handing out the data to the processes (WMP and SR) in parallel and not having one waiting on the other, otherwise you're not gaining anything by using multiple threads.

  • 0

Thanks Dr.

The speech commands affect Play, Pause, other playback controls as well as menu commands. I really don't know why the audio becomes unsynced so the idea of moving the SR to another thread is a shot in the dark. I have completed the code in a test bed and will move it into the app in the next few days. I will drop a note here to let everyone know how it goes.

The nice part of the SR being on another thread is that some of the processing (is a command valid, etc) is within that thread and SHOULD not affect any playback. I just return a string that informs the base app what I need to do, just as if the user had pressed a mouse button.

Have a great day.

James

  • 0

Thanks Dr.

The speech commands affect Play, Pause, other playback controls as well as menu commands. I really don't know why the audio becomes unsynced so the idea of moving the SR to another thread is a shot in the dark. I have completed the code in a test bed and will move it into the app in the next few days. I will drop a note here to let everyone know how it goes.

The nice part of the SR being on another thread is that some of the processing (is a command valid, etc) is within that thread and SHOULD not affect any playback. I just return a string that informs the base app what I need to do, just as if the user had pressed a mouse button.

Have a great day.

James

Did you do it delegate style? Or are you constantly checking a string for a value?

  • 0

Did you do it delegate style? Or are you constantly checking a string for a value?

Yes I am using a Delegate, thanks for asking. Only when acceptable conditions have been met is a string sent back to the calling thread. This is why I thought about going this route, all the work to insure that this is an acceptable command before affecting the app. I really do appreciate you asking to make sure.

Peace,

James

  • 0

Yes I am using a Delegate, thanks for asking. Only when acceptable conditions have been met is a string sent back to the calling thread. This is why I thought about going this route, all the work to insure that this is an acceptable command before affecting the app. I really do appreciate you asking to make sure.

Peace,

James

I know some people will thread things but then sit there waiting for the thread to finish/do something instead of carrying on and doing what needs to be done away from the thread and acknowledging when the thread has something for it. That's the reason I asked.

But yea, logically if the thread is just sitting in a loop like:

wait for command

process command

if command is good raise the event

repeat

and the main program is sitting in a

play movie/sit in idle state

**Event raised**

check event

do event

repeat

And there is no reliance on one or the other to preform individual tasks and you aren't sitting there in a:

while (x != y) or while(myThread.ThreadState == ThreadState.Running)

Then I don't see why it wouldn't work, and it should work better than a non-threaded system.

  • 0

Thanks again Firey,

Your diagram statement is exactly what is going to happen (I haven't added my new class to my app yet. I almost always create a test bed application to insure that it is working on it's own before adding it to the real application)

I still find it strange that the audio becomes unsynced.... but when I shut down the SR option, which disposes of the SR components, the issue goes away. I state this in case anyone else ever has the issue that they know that someone else has seen it.

Have a fun day.

  • 0

Thanks again Firey,

Your diagram statement is exactly what is going to happen (I haven't added my new class to my app yet. I almost always create a test bed application to insure that it is working on it's own before adding it to the real application)

I still find it strange that the audio becomes unsynced.... but when I shut down the SR option, which disposes of the SR components, the issue goes away. I state this in case anyone else ever has the issue that they know that someone else has seen it.

Have a fun day.

One thing to check, would be CPU usage. I know that in some cases High CPU usage can cause things to become un-synced. If the playback has full video decoding frames can be ready and display but the CPU can't keep up with keeping things (like the Audio) synced properly.

  • 0

One thing to check, would be CPU usage. I know that in some cases High CPU usage can cause things to become un-synced. If the playback has full video decoding frames can be ready and display but the CPU can't keep up with keeping things (like the Audio) synced properly.

Interesting thought. The app has run for two+ years on this lightwight machine but with the addition of SR it could be hitting high. I will check this out, thanks.

This topic is now closed to further replies.
  • Posts

    • Dragon's Dogma 2: Dark Arisen expansion to bring snowy region, new updates also coming by Pulasthi Ariyasinghe Capcom had a surprise waiting for Dragon's Dogma fans today in the Nintendo Direct presentation. The company revealed an expansion for the second installment with a name that should be familiar to series veterans. Coming later this year, Dragon's Dogma 2: Dark Arisen is promising a massive new region to explore, new monsters, fresh skills to learn, and more. The studio says players will be heading to the Northern region of the world, named Norgan, to find new secrets about an undying "Fallen Dragon." There will be forgotten relics that the protagonist can find to unlock fresh weapons and skills the expansion is introducing. Players will also be able to find mysterious equipment from a previous Arisen as a part of the expansion, all part of 12 Lost Rites Dungeon Challenges they must complete to gain access. In Neowin's own review, I found Dragon's Dogma 2 to be an impressive RPG when it launched back in 2024, giving the title an 8.5/10 for its class variants, companion system, and immersive exploration. "Once a prosperous region of the kingdom of Vermund, it was abandoned many years ago for reasons unknown," says Capcom about the new region. "Long has it been since any soul traveled its paths. Blanketed in heavy snow, these frigid lands are home to savage hordes and creatures of unbelievable power. Those who are capable of vanquishing such fearsome foes, or those who possess a keen eye for exploration, will find themselves rewarded with powerful relics." Dragon’s Dogma 2: Dark Arisen expansion launches on October 9, 2026, with a $29.99 price tag. Ahead of the expansion release, Capcom is also planning to release two free updates to the base game. The first will land tomorrow, June 10, bringing more accessible fast travel with an Eternal Ferrystone and other quality-of-life adjustments. The second update will land sometime in August, aiming to improve frame rates, add more save slots, and bring even more community-requested adjustments. This expanded Dark Arisen edition is also launching on the Nintendo Switch 2 on the same day the content comes to PC, Xbox Series X|S, and PlayStation 5.
    • Classic themes are just the colors on the bar like the olden days, if you use the image themes, it does fancy transparent backgrounds and it makes the elements of the app look like they are transparent bubbles. This sample image shows what it looks like.  
    • Good point, unfortunately. NextDNS has far more filters and workarounds than uBlock, and it's easy to implement.
    • Windows 10 KB5094127 Patch Tuesday improves File Explorer search and more by Taras Buria The June 2026 Patch Tuesday updates are here, bringing mandatory patches to users with PCs enrolled in the Extended Security Update program for Windows 10. Microsoft is rolling out KB5094127, with build numbers 19045.7417 and 19044.7417. Changelog includes the following: [File Explorer] This update improves File Explorer search, including support for Chinese text, and UTF 8–encoded files without a byte order mark (BOM). Text now displays more clearly and consistently across search results, Content view, and tooltips. [Secure Boot] This update enables dynamic status reporting for Secure Boot states in Windows Security App. This update adds a new policy setting, LimitSecureBootRequiredServiceData, under Computer Configuration > Administrative Templates > Windows Components > Secure Boot. When this setting is enabled, Windows limits the Secure Boot service data it sends by suppressing the event normally sent to Microsoft. This policy is also included in the Windows Restricted Traffic Limited Functionality Baseline package. For information about the policy, see Manage connections from Windows 10 and Windows 11 operating system components to Microsoft services. With this update, Windows quality updates include additional high confidence device targeting data, increasing coverage of devices eligible to automatically receive new Secure Boot certificates. Devices receive the new certificates only after demonstrating sufficient successful update signals, maintaining a controlled and phased rollout. As for known bugs, Microsoft has the following to say: A workaround is available in the official documentation. Today's updates are available for PCs enrolled in the Extended Security Updates program only. If your PC is eligible, you can download the update from Settings > Windows Update or from the Microsoft Update Catalog here.
    • Then the solution is to not let children have easy access to smart phones or internet until they are older, not mass surveillance. Only this would require parents to do actual parenting, most likely, as with any good solution to the problem.
  • Recent Achievements

    • Week One Done
      rubentuben8 earned a badge
      Week One Done
    • Week One Done
      ARaclen earned a badge
      Week One Done
    • One Year In
      jojodbn earned a badge
      One Year In
    • One Month Later
      jojodbn earned a badge
      One Month Later
    • Week One Done
      jojodbn earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      523
    2. 2
      PsYcHoKiLLa
      231
    3. 3
      +Edouard
      124
    4. 4
      ATLien_0
      87
    5. 5
      Steven P.
      83
  • Tell a friend

    Love Neowin? Tell a friend!