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

Announcements

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.

  • CU26022226-1 Profile Picture
    2 on at
    If you want to play audio in a Store Commerce app, it usually depends on the platform and framework being used. Most apps handle audio through built-in media player APIs rather than custom code from scratch. You’ll need to manage file hosting, playback permissions, and user interaction rules (especially autoplay restrictions). It’s best to integrate audio at the app layer, ensuring it doesn’t disrupt the checkout flow or performance.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Mallesh Deshapaga Profile Picture

Mallesh Deshapaga 1,089

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 192 Super User 2026 Season 1

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 190 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans