• 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

    • Bulk Crap Uninstaller 6.2 by Razvan Serea Bulk Crap Uninstaller is a free (as in speech) program uninstaller. It excels at removing large amounts of applications with minimal user input. It can clean up leftovers, detect orphaned applications, run uninstallers according to premade lists, and much more. Even though BCU was made with IT pros in mind, by default it is so straight-forward that anyone can use it effortlessly! Bulk Crap Uninstaller features: Detect and uninstall Windows Store apps Uninstall multiple items at once to speed up the process (with collision prevention) Uninstall any number of applications in a single batch Minimal user input is required during uninstallation Can find and remove leftovers after uninstallation Can uninstall some apps even if they don't have any uninstallers Detects applications with damaged or missing uninstallers Adds quiet uninstall options to some uninstallers, even if they do not support them by default Uninstall lists for automation Startup manager Verification of uninstaller certificates Fully portable, settings are saved to a single file Bulk Crap Uninstaller 6.2 changelog: Features Add invalid-uninstaller view preset by @breshinotestachegira in #903 Add certificate and integrity columns to app list by @breshinotestachegira in #894 Improve Scoop custom path detection by @breshinotestachegira in #892 Fixes Improve uninstall list load error handling by @breshinotestachegira in #895 Fix tweak visibility filtering by @breshinotestachegira in #898 Fix orphaned-only view preset by @breshinotestachegira in #899 Stabilize icon handle ownership by @breshinotestachegira in #902 Fix: Use Directory.GetLastWriteTime for install date fallback by @AniketDeshmane in #908 Do not offer to send "no way to uninstall" error messages by @Klocman in #922 Ignore ERROR_BAD_CONFIGURATION when listing MSI components by @Klocman in #924 Eat InvalidOperationException coming from ListViewGroupAccessibleObject by @Klocman in #925 Harden BCU console export and size detection - Fix BCU-console export failures by @breshinotestachegira in #897 Harden registry factory parsing by @breshinotestachegira in #893 Guard startup uninstall list loading by @breshinotestachegira in #927 Clean generated files on uninstall by @One-Simon in #928 Translations Updated Hungarian translation by @titanicbobo in #875 Updated Vietnamese translations by @wanwanvxt in #918 Fix : Swedish translation causes UI overflow in some windows by @Leise-Shadow in #865 Other Fix publish script after v6.1 by @tsiakoulias in #868 Updated the localization pack Repository Moved the repository under a new BCUninstaller organization (old links still work) Added two maintainers: @hazeliscoding and @One-Simon Added PR merge rules (require up-to-date approval and CI to pass) Updated CI script to also build the launcher (only for testing, not included in artifacts) Download: Bulk Crap Uninstaller 6.2 | 8.8 MB (Open Source) Download: Bulk Crap Uninstaller Portable | 11.6 MB View: Bulk Crap Uninstaller Home Page | GitHub | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • If built properly, swapping out the backend should be an easy task, but as the article points out, it's just Apple not wanting to do this.
    • Microsoft's new Xbox Shutdown change promises massive power efficiency gains by Pulasthi Ariyasinghe Microsoft has been delivering a lot of changes for Xbox Insiders to test in recent weeks, and today, another wave of changes aimed at consoles was announced. The latest drop is testing features that let users find mutual friends easier, customize their UI, and streamline wishlisting. When looking at an Xbox friend's profile, an option will appear to see mutual friends, perhaps to get a refresher on how you know that person. This will depend on the privacy settings. The same applies to when checking the profile of a person who is not in the friends list, offering a quick way to find out if this is a known connection. Next, Microsoft is giving the option to change how the 'Home' and 'Games & Apps' sections show off available games. There is a new poster style that users can enable for an "immersive library experience." "We’ve also made personalization settings easier to navigate and customize by separating Home and My Games & apps into separate sections," adds the company. "And to make personalization even more accessible, we’ve added new shortcuts throughout menus, so you can quickly jump in and tailor your XBOX experience the way you want." Moreover, heading to the store page of an unreleased game will now offer players the option to wishlist directly from the game card. Lastly, Microsoft is making a change to Xbox One and Xbox Series X|S consoles that are in Sleep mode, making them use the more energy-saving 'Shutdown' mode instead automatically. The company says this can increase power savings by up to 20 times without impacting "performance, gameplay, or your ability to receive system, games or apps updates overnight." The only down side seems to be a longer startup time that can take up to 45 seconds. The setting was originally introduced in 2023, and this is only the latest update to it. The power option can be changed from the console settings at any time. This Xbox Insider update is rolling out today to select members of the program. As usual, Microsoft aims to bring it to more Insiders over time before they reach all Xbox owners. Head here to find out how to join the Xbox Insider Program to get a chance to test these features and upcoming ones on both consoles and PC.
    • 2 was a fun game but felt a bit shallow, like not enough there. I hope this expansion fixes that.
  • Recent Achievements

    • Rookie
      lamborghiniv10 went up a rank
      Rookie
    • One Month Later
      pinnclepd earned a badge
      One Month Later
    • First Post
      X-No-file earned a badge
      First Post
    • One Month Later
      johnjacobb40 earned a badge
      One Month Later
    • One Year In
      Primer1st earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      507
    2. 2
      PsYcHoKiLLa
      211
    3. 3
      +Edouard
      145
    4. 4
      Steven P.
      88
    5. 5
      ATLien_0
      80
  • Tell a friend

    Love Neowin? Tell a friend!