Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
Real streaming (chunk, not full loading)

leye0
Registered User
Quote
2012-03-16 02:42:51

Hello niko and al.,

I've been searching during some days for how to stream with Irrklang. My goal is to be able to play lot of chunks of PCM data (in the form of a 1024 or etc bytes array) to an engine.Play2D and to not hear a space (glitch) between each sample.

I want to be able to access PCM chunks before they are played.

I've tried the IFileFactory. This is interesting, because I'm able to access chunks so I can show their FFT spectrum.

But I want to do the same for a PCM placed in memory, and of Undefined size, so I can add effect (ParamEQ), add my own effects, show the spectrum then play a sound that is directly generated in a Stream. i.e. 100 times a square-shaped wave of 30HZ.

Should I use another library? I feel that my needs are maybe different from what the library offers.

Thanks! :)


niko
Moderator
Quote
2012-03-16 07:56:19

irrKlang doesn't support own, custom streaming easily. Some people are using workarounds for this, like overriding the file access for this as you wrote, but it's not ideal and probably not what you want.
So basically yes, irrKlang is probably not the library you want for this, I'm sorry.


forigen
Guest
Quote
2012-06-26 12:39:05

i'm quiet noob in programming, can u give me some help in implementing internet audio stream via ur library.
i ve understood that i should implement my own IFileFactory::openFile method, but i dont have any idea about how should i do this ..


i know it's stupid but i tried to use stream from System.Net.WebResponse.GetResponseStream() and when i pass it to ISoundEngine.AddSoundSourceFromIOStream() it raises an exception

also i tried to make it work another way.
i used System.Net.WebResponse.GetResponseStream() to put data to byte array in a separate thread, initially passing this byte array to ISoundEngine.AddSoundSourceFromMemory() method. All i got was a short chunk of streming file.

please any help, sources would be appreciated, but a good advice is a quiet enough.
sor for my english


niko
Moderator
Quote
2012-06-27 07:46:36

Copying the data you get from your internet stream and giving it to irrklang is a good way. The problem might be that your stream might be to slow loading, causing irrklang to stop playing it then.


forigen
Guest
Quote
2012-06-28 00:29:38

so ve decided to implement my own IFileFactory but it still works not as i wish it works

is lightly changed OvverrideFile acces proj from examples
here is a source code

http://www.sourcepod.com/nglfsn50-7890


forigen
Guest
Quote
2012-06-28 10:57:43

so i've solved everything, except one thing, an overriding stream closes itself, i think irrklang ISoundEngine closing it, but i dont now why and how it does it


forigen
Guest
Quote
2012-06-28 11:25:24

i ve found problem
ISoundEngine closes inner stream when first chunk of recieved bytes was played , please help solve this


niko
Moderator
Quote
2012-06-29 06:46:07

I guess irrKlang ask you to provide a number of bytes, but in the beginning you don't have that much bytes and give it a bit less. So irrKlang thinks the file ends here (the only reason it knows why you cannot give enough data), and stops the sound. If this is the problem, you should probably wait a bit with streaming and start playing it after you have enough bytes.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "In?ernational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact