Nativescript-sound - sound is not played?


var sound = require(“nativescript-sound”);

No errors in console ( and if I put other non-existing filename - then it shows an error : “file not found”) - so it does see the file.

Why doesn’t it play ?


tnsinfo :


If I put

  let tada = sound.create("~/raw/beep.mp3");

as a field ( outside a function):

  tada = sound.create("~/raw/beep.mp3");

then it does work.

I don’t want to initialize it as a field.

Is it possible to use it as a pseudo : Promise(loadFile).then(playFile) ?


Hi @Royi_Namir
Here’s how I used {N} sound plugin in my app.

I created a “sounds” folder in my app folder. (not inside App_Resources), and placed my sound file there, (an mp3 file).

And then to play the song,

const TNSPlayer = require("nativescript-audio").TNSPlayer;

const player = new TNSPlayer();
                audioFile: "~/sounds/name_of_file.mp3",
                loop: false
            .then(() => {

Cheers! Happy NativeScripting :slight_smile:



That’s another plugin.


i’m using nativescript-sound. not nativescript-audio


Try switching to nativescript-audio then! I has worked well for me

Nativescript-sound was last published 2 years ago. It might be outdated