nmpPlaySound (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

MX2i pro, CX1 pro/flex/warp, SX1, MX2 turbo, NX-200, NX-400, NX-900, LX2

Firmware version:

2.80 / 1.00.00

Nav. API level:

2


This function will play a sound on the NMP.

The file to play must be a .wav file (Waveform Audio File Format) and must be located on the NMP device - e.g on the SD-CARD.

Only one sound can be played at the same time.

 

Input:

loop : BOOL (Default: FALSE)

TRUE:

The sound will loop. To stop the loop, call nmpPlaySound with an empty file name.

FALSE:

The sound will be played once.

 

filename : STRING

The path to the sound file to play. Use an empty string to stop playing a looping sound. The string must be less than 200 characters. If the file can not be found, the default sound will be played.

 

 

Returns: INT

0

- Success.

-1

- Navigation interface is not open.

-2

- Error communicating with navigation device.

-4

- The navigation device rejected the command.

-8

- File name too long.

-11

- This is not supported by the device (e.g. the device is not an NMP device).

-12

- Navigation interface is busy.

 

Declaration:

FUNCTION nmpPlaySound : INT;
VAR_INPUT
  loop     : BOOL := FALSE;
  filename : STRING := "";
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
BEGIN
  ...
  //Play sound for 5 seconds
  nmpPlaySound(loop := TRUE, filename := "\SD Card\NMP\msg.wav");
  sleep(delay := 5000);
  nmpPlaySound();
  ...
END;
END_PROGRAM;