Siri keeps talking while playing a MP3-URL from Script-Output in Shortcuts

Hello.

Maybe somebody knows this issue and can give me a hand:

I have a Sri-shortcut that opens a Scriptable-script.
This script finds an URL to an MP3-file and sets this URL as output of the script.
Then it finally calls the Script.complete method.

The MP3 file then starts playing fine in the shortcut. But after a few seconds siri keeps
talking things like “Wait a second”, “There is something going wrong” ect while the MP3-file
keeps playing. I do not know what the exact texts from Siri are in English because my iPhone
is set to German but I think you know what I mean.

What am I doing wrong here? How can I play the MP3-file without having Siri talk?

Thanks a lot!

Simon.

It is hard to debug what you have without it being shared.

Hello sylumer,

See the Link to the scriptable script:

See function in line 83: playComedyWithSiri()

Thanks a lot.

1 Like

Here is just the section of the code that gets the MP3-URL and sets it as output:

/*****************************************************

    Funktion:     aboutToPlayComedyFromSiri
    
    Beschreibung: Versucht ein Comedy-Programm wegen
                  einem Befehl an Siri wiederzugeben.
    
******************************************************/

async function aboutToPlayComedyFromSiri()
{
    let findWord  = args.plainTexts[0];
    let comedy    = findComedy(findWord);
    
    if(comedy == null)
    {
        Script.complete();
        return;
    }
    
    await playComedyFromSiri(comedy);
    Script.complete();
    return;     
}

/*****************************************************

    Funktion:     playComedyFromSiri
    
    Beschreibung: Gibt ein Comedy-Programm ausgelöst
                  durch ein Kommando an Siri wieder.
                  
    Parameter:    comedy - das Comedy-Programm.
    
******************************************************/

async function playComedyFromSiri(comedy)
{
    let randomMP3URL = "";
    
    randomMP3URL = await getRandomMP3URL(comedy.url);
    
    Script.setShortcutOutput(randomMP3URL);
} 
1 Like

Here is the shortcut part: