Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
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! :) |
||||
|
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. |
||||
|
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 |
||||
|
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. |
||||
|
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 |
||||
|
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 |
||||
|
i ve found problem ISoundEngine closes inner stream when first chunk of recieved bytes was played , please help solve this |
||||
|
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. |
|