[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Play sound once when triggered.

From: Steffen Kiel
Subject: Play sound once when triggered.
Date: Mon, 14 Dec 2020 13:06:50 +0000

Hello all.

I would like to implement this feature where i am able to play out a short sound, but only once. 
The problem with the "Wav file source" block is that if you disable repeat, it only plays once when the GUI starts. There is as far as i know, no way to re-trigger it?

So far i have created a python block which handles the data, and sends out a PMT message for when the audio should play. 

The first solution i came up with, was to send this message to a "Mute" block placed in between the file source and audio sink blocks. But the problem with this is that even though it is muted, the file source stream still continues and therefore when you send the unmute message, the audiostream can be anywhere in the audio file and not necessarily at the beginning. So this method is not very clean.

I thought of creating my own wav file source embedded python block, which accepts messages as input, but i'm not sure how to implement the whole file source part.. Or if there is any easier way of doing this..?

Any suggestions?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]