Applies to: WAVE
Summary
This article describes the steps needed to play required audio files on Hanwha IP Speakers on camera events by setting up rules in WAVE with an appropriate SUNAPI http command. Two devices are needed to achieve this: a controller, such as SPA-D1000 Audio Module, to route the SUNAPI command, and a speaker, such as SPA-H100, to play audio.
Setting up the SPA-H100 Speaker
To set up the speaker:
- Login to the speaker with username and password.
- If the speaker firmware version is less than 3.4.4.12, download the latest version and upgrade using the following steps.
NOTE: The latest firmware can be found at the product page on Hanwha Vision America.
If an upgrade is not needed, go to Time Setting.
- Select Environment Setting > System Management.
- On the System Upgrade page, select the downloaded upgrade file, then click Apply.
- After the upgrade completes, under Factory Default Setting, click Apply next to Network Status to factory default the unit.
Time Setting
- Select Environment Setting > Time Setting.
- Set the correct time zone and date/time.
- Click Apply.
Network Setting
- Select Environment Setting > Network Setting.
- Setup the IP Address and Subnet Mask, then click Apply.
Device Operation Setting
- Select Environment Setting > Device Operation Setting.
- Set Operation Mode to Speaker, then click Apply.
- Set Power Mode to PoE+.
NOTE: Set to PoE only if PoE+ power is not available.
- Click Apply.
TTS File Management
- Select Operation Setting > TTS File Management.
- Add TTS files by entering text.
- Select language and gender.
- Select Start Chime and End Chime.
- Click Save.
Source File Management
- Select Operation Setting > Source File Management.
- Click Browse to add audio files (mp3, wav, tts), then click Upload.
Uploaded audio files appear in Source File List in right hand side.
- To check audio files, click Number under Source File List.
Setting up the SPA-D1000 Controller
To set up the SPA-D1000 controller:
- Login to the controller with username and password.
- Select Environment Setting > System Management.
- Under System Upgrade, setup the latest version of the firmware using the instructions in Setting up the SPA-H100 Speaker.
- Select Environment Setting > System Management.
- Under Factory Default Setting, click Apply by Network Status Maintain.
Time Setting
- Select Environment Setting > Time Setting.
- Set the correct time zone and date/time.
- Click Apply.
Network Setting
- Select Environment Setting > Network Setting.
- Setup the IP Address and Subnet Mask, then click Apply.
Device Operation Setting
- Select Environment Setting > Device Operation Setting.
- Set Operation Mode to Controller, then click Apply.
Device Registration
- Select System Setting > Device Registration.
- Move the speaker under Device Search to the right hand side.
The speaker appears under Registered Device.
- Click Apply.
Register the Speaker Audio Files in the Controller
MP3/WAV Files
- Select System Setting > Source Registration.
- Enter the ID in the ID field.
- In IP Address, select the speaker IP.
- Enter the model name in the Model Name field.
- Enter H100 in Device Name.
- Enter “ “ in the Location field.
- Enter 3000 in the Priority field.
- Enter Horn in the Source Name field.
- Enter BGM for the Source Type.
- Enter 1-BGM in the CTRL&Name field.
- Select AOE-Multicast in the Transmission drop-down menu.
- : Select 224.124.0.2 in the TransIP drop-down menu.
- Select 5454 for the Port.
- Select the checkbox under CTRL.
- Select Speaker-IP in the CTRL IP drop-down menu.
- Select file_player in the CTRL type drop-down menu.
- Click Apply.
TTS Files
To register the speaker:
- Follow steps 1-8 in MP3/WAV Files.
- Enter TTS for the Source Type.
- Enter 2-TTS in the CTRL&Name field.
- Select AOE-Multicast in the Transmission drop-down menu.
- Select 224.124.0.2 in the TransIP drop-down menu.
- Select 5454 for the Port.
- Select the checkbox under CTRL.
- Select Speaker-IP in the CTRL IP drop-down menu.
- Enter SPA-H100 in the Device Name field.
- Select tts_player in the CTRL type drop-down menu.
- Enter 2 in the I/O CH field.
- Click Apply.
- Select System Setting > Zone Registration.
- Enter the Zone Name.
- Enter Speaker IP in the IP Address field.
- Enter audio_output_1 in the Channel field.
- Select System Setting > Group Setting to create speaker groups with zones if needed. (Group ID or Speaker ID can be used in SUNAPI command).
NOTE: Audio/TTS files will not play in the SUNAPI command if Zone and Group are not
setup.
Confirming Controller Settings
To confirm the controller settings:
- Select Operate > Button Mode > Source > Zone.
Source and Zone appear under Property.
- Click Stop Broadcasting, then Start Broadcasting.
- Under Source Control, select the audio file from the drop-down and click Play.
Music plays in the speaker.
Discovering Speakers and IDs
The speakers and IDs on the server are needed to play audio on a speaker.
NOTE: admin credentials are required to run SUNAPI command.
- Open a browser and enter the command.
http://IP-of-Controller/stw-cgi/system.cgi?msubmenu=registeredsubdevices&action=view
for example, http://192.168.2.90/stw-cgi/system.cgi?msubmenu=registeredsubdevices&action=view
- Note the ID of the speaker from the browser.
Sample output of http command in browser.
{
"IP": "192.168.2.90",
"ID": 3,
"NAME": "SPA-D1000",
"TYPE": "SPEAKER"
},
{
"IP": "192.168.2.91",
"ID": 2,
"NAME": "SPA-H100",
"TYPE": "SPEAKER"
}
Discovering Speaker Groups and IDs
To discover speaker groups:
NOTE: Group ID is needed in http command to play audio.
- Open a browser and enter the command with Controller IP.
http://IP-of-Controller/stw-cgi/system.cgi?msubmenu=speakergroups&action=view
for example, http://192.168.2.90/stw-cgi/system.cgi?msubmenu=speakergroups&action=view
- If the Speaker Group with associated Zone is not created, the command will not work.
- Note the Group IDs from the browser response.
"Group": [
{
"ID": "1",
"Name": "Group1",
"DeviceIDs": "1,2"
},
Discovering Audio Files Accessible by Controller
To discover audio files:
- Open a browser and enter the command with ControllerIP.
http://IP-of-Controller/stw-cgi/eventrules.cgi?msubmenu=audiooutfiles&action=view
for example, http://192.168.2.90/stw-cgi/eventrules.cgi?msubmenu=audiooutfiles&action=view
- Note the audio file names (needed in http command to play back in speakers).
"AudioOutFiles": {
"FreeSpace": "1024",
"TotalSpace": "1024",
"AudioClips": [
{ "Name": "Src1_Song1.mp3" },
{ "Name": "Src1_Song2.mp3"
Discovering TTS Files Accessible by Controller
To discover TTS files:
- Open a browser and enter the command with the Controller IP.
http://IP-of-Controller/stw-cgi/eventrules.cgi?msubmenu=ttsfiles&action=view
for example, http://192.168.2.90/stw-cgi/eventrules.cgi?msubmenu=ttsfiles&action=view
- Note the TTS file names in the response. The response appears as:
"TTSFiles": {
"TTSList":
[{ "Name": "Src1_TestTTS” } ]}
NOTE: tts file name does not have an extension.
Testing the Commands to Play Audio from a Specific Speaker
- Open a browser, enter the command using ControllerIP and SpeakerID. Sample commands are shown below.
http://192.168.2.90/stw-cgi/eventrules.cgi?msubmenu=audiooutfiles&action=control&Type=Play&Name=Src1_Song1.mp3&SpeakerID=2
http://192.168.2.90/stw-cgi/eventrules.cgi?msubmenu=ttsfiles&action=control&Type=Play&Name=Src1_TestTTS&SpeakerID=2
The audio plays in the speaker.
Testing the Commands to Play Audio from a Group of Speakers
- Open a browser and enter the command using ControllerIP and SpeakerGroupId. Sample command is shown below.
http://192.168.2.90/stw-cgi/eventrules.cgi?msubmenu=audiooutfiles&action=control&Type=Play&Name=Src1_Song2.mp3&GroupID=1
- Once audio is confirmed, the above http SUNAPI commands can be used to setup an event rule in WAVE. These can be played from a single speaker or group of speakers.
Resolutions to Errors
- When a command is executed, the browser indicates Response = Success and the speaker plays the requested audio.
- If there are http Errors:
Response=Fail
code=608
Error = Feature not implemented or not supported
Check whether the Speaker IP is
used. It should use the Controller IP.
- If the Response = fail or code=609, not authorized, check whether there is space or other characters in the URL.
- If the sign in box keeps coming back, check whether an invalid password was entered.
Setting up WAVE Rules to Play Audio on IP Speaker
To set up WAVE rules:
- Open WAVE.
- Click Ctrl + E to open the Event Rules.
- Click +Add.
- Under Event, select Analytics Event from the When drop-down menu.
- Select the required camera from the At drop-down menu.
- Select the setup analytics such as Intrusion from the Event Type drop-down menu.
- Under Action, select DoHTTP(S) request from the Do drop-down menu.
- Select the checkbox by Interval of Action.
- Increase the default as needed.
- In HTTP(s) URL, enter the tested command to play TTS or audio files on a specific speaker or group of speakers.
- Enter the speaker credentials in Login field.
- Click Apply.
Once Rule is setup in WAVE, audio plays in the IP Speaker when an analytic event is triggered in the camera.