API Announce is not audible

Hello, all.

I’m hoping to integrate some IoT (Arduino, ESP32, etc) into my AmpliPi set up. I’m having limited success with the API using a browser REST add-on ( Postman / RESTer).
I am able to adjust the Volume of a zone. Or mute.

I’ve

When I try to execute the Announce end point … the audio in my zone goes silent - but I do not hear the sample audio file.

Do I need to add this as a ‘stream’ source first ? Or should I set up a ‘preset’ first ?

The use case I"m thinking of is : using a microcontroller (esp32) that could have a ‘volume knob’, buttons to change sources, and a PIR to detect motion -which would trigger an announcement via API calls.

Any suggestions ?

Van

I got it to work… my problem is: I didn’t understand how the ‘sources’ end-point really works.

For me:
source_id: 0 is my ‘virtual’ inputs ( multiple internet streams )
source_id: 1-3 have been configured as RCA inputs

my office is zone: 0
the outside speaker is zone: 2

first, I set my office (0) and outside (2) to an RCA (3)

with the endpoint → http:/amplipi.local/api/zones/ *note the actual zone is not specified
body:
{
“zones”: [
0,
2
],
“update”: {
“source_id”: 3
}
}

then, I change to the ‘virtual input’ source (with multiple streams) with:
with the endpoint → http:/amplipi.local/api/zones/ *note the actual zone is not specified
body:
{
“zones”: [
0,
2
],
“update”: {
“source_id”: 0
}
}

It instantly changes to the stream input which is set for source_id(0)… but THEN, I can do an announcement on the ‘Virtual Input’ source_id:

endpoint: http://amplipi.local/api/announce
body:
{
“media”: “https://www.nasa.gov/mp3/640149main_Computers%20are%20in%20Control.mp3”,
“source_id”: 0
}

if I try to announce on the RCA source, it does NOT play (only silence during the duration of the play).
{
“media”: “https://www.nasa.gov/mp3/640149main_Computers%20are%20in%20Control.mp3”,
“source_id”: 3
}

Are you able to play an internet radio station out source 3? Announcements should work for any source so I am worried you may have a hardware issue.

Thanks, Lincoln.

I cannot play an internet station on source_id=3 ( what looks like #4 in the UI ). I have RCA inputs on source_id= 1-3 and all seem to work. But I can only stream on source_id=0.

And I can ONLY ‘announce’ on source_id(0). If I try to announce on a different source, it is muted - but the sound file cannot be heard.

I figured out the API ! I plan to publish some sample python and arduino sketches very soon (based upon my current situation with source_id=0).

VZ

Yup that’s definitely a hardware issue. We will contact you over email to arrange for replacement parts.

As for the API awesome! There’s also a python client if that helps: GitHub - brianhealey/pyamplipi: Python API for interacting with the AmpliPi Multizone Audio Controller

Thanks, Lincoln.

I have a nice example of an esp32 (Arduino) code base that can: adjust volume, play announcements, change source/stream.
AmpliPi-ttgo

 In my case,  I need a volume knob; ability to change streams, and I wanted an announcement to play when a motion sensor is triggered. 

I also have some python code stubs.

2 Likes