Summary:ASTERISK-06575: Allow modifying channel with effect
Reporter:Nickolay V. Shmyrev (nsh)Labels:
Date Opened:2006-03-20 10:52:50.000-0600Date Closed:2011-06-07 14:02:52
Versions:Frequency of
Environment:Attachments:( 0) ast_svn_freq_scale.diff
Description:I was needed to apply effect on asterisk channels. For example, modify voice pitch or modify speed and so on, apply fade or reverb.

I've wrote the attached patch. I think it's nice capability and would be happy to see that code included.

Actually I am a newbie in asterisk architecture, probably that task should be solved differently, but I would be happy to update patch to make it perfect.
Comments:By: Joshua C. Colp (jcolp) 2006-03-20 11:10:33.000-0600

I would first like to start out with congratulating and welcoming you to the architecture of Asterisk. Hopefully your stay won't be too bad. Here's what I think of your patch though: It's good and could be used as a basis for something even bigger. What has been previously discussed is something called "shims". These are essentially what you call "effects". Shims would be a method of injecting callbacks into the audio path of a channel (potentially via the translation path like you have done) that would pass the audio frame (probably as signed linear) to the function so that it could then modify the frame in however you want. Ideally in my mind this would use a linked list of structures containing pointers to data that the shim can use, a pointer to the function callback, and a pointer to a destroy callback so that the data can be destroyed if used. Would shims be something that you would like to evolve your code to and help contribute and develop?

By: Jeffrey C. Ollie (jcollie) 2006-03-20 12:38:30.000-0600

Having chains of effects sounds like we're moving in the direction of GStreamer's pipelines...

By: Nickolay V. Shmyrev (nsh) 2006-03-20 14:50:48.000-0600

Asterisk with gstreamer, that will be killer app :), moreover I suspect gstreamer will support SIP and other channels sometime, and will be used as PBX. At least it's architecture is so generic that nothing prevent such thing.

joshnet: Surely it looks interesting, I've found only this svn branch


are there other entry points for this design? What exactly should I do?

By: Joshua C. Colp (jcolp) 2006-03-20 14:54:09.000-0600

I used that branch to learn about the translation core, so it's not made for general consumption. As for actual entry points for this, really right now there are none... we need to brainstorm and reach a consensus on how we want it to integrate.

By: Jeffrey C. Ollie (jcollie) 2006-03-20 14:56:52.000-0600

GStreamer 0.10 already has RTP (haven't used it, so can't comment on the quality).  I have an experimental format_gstreamer that uses GStreamer to write OGG/Vorbis audio files.  I haven't gotten format_gstreamer reading from files yet - mostly haven't had any time to get back to it.  If I can get reading and writing working you should be able to specify any number of GStreamer pipelines in a config file for writing a wide variety of audio/video formats.

By: opsys (opsys) 2006-04-04 19:44:51

If I read this correctly you would be able to 'inject' audio, mix it and pass it along. Would these shims also allow you pass audio from a channel into another? (IE: Whisper, reverse ChanSpy??)

By: Nickolay V. Shmyrev (nsh) 2006-04-04 23:38:43

There are four things that should be ported and may be ported quite easily

1. spying
2. monitoring
3. encoding/decoding
4. volume adjustment

But of course if there will be more advanced architecture, more interesting things like channel mixture are possible. Unfortunately for my opinion there should be bound of the flight of phantasy :) Otherwise planned changes will never be implemented.

By: Joshua C. Colp (jcolp) 2006-04-05 11:37:37

Okay here we go folks. I think we should all move this to the Asterisk-Dev mailing list instead of tying up the bug tracker with it. When we reach a consensus between the community and core developers of how this should work - then we can come back here. If everyone agrees meh then just talk on the mailing list ;) if you don't then post a note.