# How to get codec payload/stream data for live audio stream?

**URL:** <https://community.wowza.com/t/how-to-get-codec-payload-stream-data-for-live-audio-stream/38439>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [August 13, 2012, 12:51pm UTC](https://community.wowza.com/t/how-to-get-codec-payload-stream-data-for-live-audio-stream/38439 "2012-08-13T12:51:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_Gibson](https://avatars.discourse-cdn.com/v4/letter/t/dfb087/32.png) [@Tom\_Gibson](https://community.wowza.com/u/Tom_Gibson)\
**Post date:** [August 13, 2012, 12:51pm UTC](https://community.wowza.com/t/how-to-get-codec-payload-stream-data-for-live-audio-stream/38439/1 "2012-08-13T12:51:10Z")

</div>

Hi,

I’m wanting to try and take multiple published audio streams (from Flash/RTMP), merge them, and then create one new stream which is the combined audio.

I’m mostly wondering what interfaces / methods to look at to acquire the live audio stream codec data (Nellymoser or Speex from Flash control). I think I saw there was a JSpeex sample that at least demonstrates how to create a stream from Java.

Thanks,

Tom

---

<div class="post-metadata">

**Author:** ![Tom\_Gibson](https://avatars.discourse-cdn.com/v4/letter/t/dfb087/32.png) [@Tom\_Gibson](https://community.wowza.com/u/Tom_Gibson)\
**Post date:** [August 15, 2012, 9:11am UTC](https://community.wowza.com/t/how-to-get-codec-payload-stream-data-for-live-audio-stream/38439/2 "2012-08-15T09:11:53Z")

</div>

Anyone know if the Wowza API allows for this? I got thinking of an alternative setup which could be to use localhost UDP/RTP to pass the published stream to a custom app, then have it publish a new one that merged audio.

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [August 15, 2012, 5:18pm UTC](https://community.wowza.com/t/how-to-get-codec-payload-stream-data-for-live-audio-stream/38439/3 "2012-08-15T17:18:55Z")

</div>

You can use IMediaStreamActionNotify.onAudioCodec. Take a look at this example:

[https://www.wowza.com/docs/how-to-use-imediastreamactionnotify3-interface-to-listen-for-rtmp-stream-events-includes-codec-info](https://www.wowza.com/docs/how-to-use-imediastreamactionnotify3-interface-to-listen-for-rtmp-stream-events-includes-codec-info)

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [August 15, 2012, 5:42pm UTC](https://community.wowza.com/t/how-to-get-codec-payload-stream-data-for-live-audio-stream/38439/4 "2012-08-15T17:42:23Z")

</div>

I’m not sure if that is possible, but take a look at IHTTPStreamerCupertinoLivePacketizerDataHandler.onFillChunkDataPacket. Take a look at this example:

[https://www.wowza.com/docs/how-to-convert-ontextdata-events-in-a-live-or-vod-stream-to-timed-events-id3-tags-in-an-apple-hls-stream](https://www.wowza.com/docs/how-to-convert-ontextdata-events-in-a-live-or-vod-stream-to-timed-events-id3-tags-in-an-apple-hls-stream)

Richard

---

<div class="post-metadata">

**Author:** ![Tom\_Gibson](https://avatars.discourse-cdn.com/v4/letter/t/dfb087/32.png) [@Tom\_Gibson](https://community.wowza.com/u/Tom_Gibson)\
**Post date:** [August 15, 2012, 9:21am UTC](https://community.wowza.com/t/how-to-get-codec-payload-stream-data-for-live-audio-stream/38439/5 "2012-08-15T09:21:33Z")

</div>

Thanks. I think I played with that already and found the debugger only called the audio codec info callback once for a published stream and not once for every chunk of audio data.

---

<div class="post-metadata">

**Author:** ![Tom\_Gibson](https://avatars.discourse-cdn.com/v4/letter/t/dfb087/32.png) [@Tom\_Gibson](https://community.wowza.com/u/Tom_Gibson)\
**Post date:** [August 20, 2012, 6:37pm UTC](https://community.wowza.com/t/how-to-get-codec-payload-stream-data-for-live-audio-stream/38439/6 "2012-08-20T18:37:32Z")

</div>

I’m not sure if there is a better way, but I found I was able to do this by creating a custom live packetizer, which then gets a callback for each AMFPacket.
