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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

Playing Audio in the Store Commerce App

(2) ShareShare
ReportReport
Posted on by 9

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.

  • Suggested answer
    CU26022226-1 Profile Picture
    4 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.
  • CU26022226-1 Profile Picture
    4 on at
    Playing audio in a Store Commerce app can enhance user experience, whether it’s for product demos, announcements, or background music. Typically, audio files are integrated through the app’s media player APIs and triggered by specific user actions or events. It’s important to manage file size, playback performance, and user controls to avoid interruptions during shopping. For documenting or reviewing audio content, tools like video transcription free can help convert recordings into text efficiently.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Mallesh Deshapaga Profile Picture

Mallesh Deshapaga 330

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 251 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 151 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans