web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Unanswered

Playing Audio in the Store Commerce App

(0) ShareShare
ReportReport
Posted on by 5

I’m trying to extend the POS so that when the user scans a barcode if the barcode does not correspond to a product, the POS with play an audio file to alert the user that the barcode they just scanned is invalid.

audio-in-pos-code.png

I have added a Sounds folder under the Resources folder in my POS project in the CommerceSDK. When we build the CommerceSDK locally it is replicating this audio resource folder to C:\Program Files\Microsoft Dynamics 365\10.0\Store Commerce\Extensions\BHS.Commerce\POS\Resources\Sounds\alarm.mp3.

CommerceSDK-files.png

At runtime audio.src is set to local.storecommerce.dynamics.com/.../alarm.mp3, and it doesn’t give me an error, but the audio doesn’t play. I have confirmed the SCA's ability to play audio with this code by replacing the local call with a URL to an MP3 (https://www.soundjay.com/misc/sounds/bell-ringing-01c.mp3) which is played.

However, we need to support this functionality in offline mode, so we are hoping to have it available as a local resource. I have tried to make a reference to the audio on the POS project manifest file in the resources section, but it never compiles.

I have also tried creating an audio.d.ts file under Pos/Libraries that contained the following code:

declare module "*.mp3";

declare module "*.wav";

 

Then in my RequestHandler I added the import statement:

import note from '../../Resources/Sounds/alarm.mp3';

 

And then I created the Audio object with this code:

let audio = new Audio(note);

 

My extension failed to load on the SCA when I did this though.

Ultimately, I've confirmed that the code playing the audio is working so the issue has to do with the location of the audio file in my resources and/or how the CommerceSDK is making that resource available at the SCA. Any advice on how to link the resource up with my codebase would be greatly appreciated.

I have the same question (1)
  • huijij Profile Picture
    19,811 on at

    Hi Cgarvey,

    Please wait patiently for others on the forum who have such experience.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 231 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 228 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 125 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans