• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Generating Sounds

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Generating Sounds

    I would love to use Valence to redevelop our barcode scanning applications. The main problem I have is the ability to be able to generate appropriate sounds when error conditions occur. The nabPlaysound option is great, but the sounds available just don't work well in a loud manufacturing environment. I tried putting a script together to use our own sound files, but this would only work on desktop. Do you have any script examples that work for both desktop and mobile?

    Thanks

  • #2
    In the upcoming 6.3 update, you will be able to run a script, passing the file you would like to play on the mobile device. This is for mobile only.

    We will be updating the Valence Mobile application for iOS and Android, which will probably be updated before the 6.3 update is released this month. This functionality will require the latest version of both once they are available.

    Example:
    Code:
    Valence.mobile.Sound.play({
        url : '/myResources/beep-05.mp3',
        callback : function (response) {
            // check if error occured
            //
            if (!response.success) {
                console.log('error playing sound: ', response)
            }
        }
    });
    ?

    Canned sounds example:
    Code:
    Valence.mobile.Sound.play({
        type : 'error' // Other canned types 'success', 'confirmation', 'alert'
    });

    Comment


    • #3
      Thanks for the quick response. Do you know when the next update will be available? Just to clarify, will this only work if you're using the Android or iOS apps and not if launched as a URL in the browser on a mobile device?

      Comment


      • #4
        Instead of what I said before, in the next 6.3 update you can just use nabPlaySound, setting it to either alert, chime, confirmation, error, or success. Otherwise, you can pass a relative URL for a sound file, for example: /companyResources/sounds/mysound.wav. This will work on desktop, mobile, and within the Valence mobile portal.

        The next update should be released next week, likely around Dec 17.
        Last edited by robert.swanson; 12-12-2025, 11:56 AM. Reason: added build date

        Comment

        Working...
        X