≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Cannot add sound source, it exists already:
Posted by:
(you are not logged in)
Enter the missing letter in: "I?ternational"
(you are not logged in)
Text:
[quote][b][/b] wrote: It's not about the stream instance. I used it as an example and I understand that it can not play the same stream. It's about IrrKlang not being able to have same sound name. Maybe this code snippet will be more helpful to see where I'm coming from. [code] FileStream streamOne = new FileStream(mp3AudioPath, FileMode.Open, FileAccess.Read, FileShare.Read); FileStream streamTwo = new FileStream(mp3AudioPath, FileMode.Open, FileAccess.Read, FileShare.Read); if (streamOne.Equals(streamTwo)) Console.WriteLine("Streams are equal"); else { Console.WriteLine("Streams are not equal"); ISoundSource sourceOne = engine.AddSoundSourceFromIOStream(streamOne, mp3AudioPath); ISoundSource sourceTwo = engine.AddSoundSourceFromIOStream(streamTwo, mp3AudioPath); // Error, not because streams are the same but because mp3AudioPath is the same. engine.Play2D(sourceOne, false, false, false); Thread.Sleep(3000); engine.Play2D(sourceTwo, false, false, false); // Does not play because sourceTwo is null } [/code] [code] FileStream streamOne = new FileStream(mp3AudioPath, FileMode.Open, FileAccess.Read, FileShare.Read); FileStream streamTwo = new FileStream(mp3AudioPath, FileMode.Open, FileAccess.Read, FileShare.Read); if (streamOne.Equals(streamTwo)) Console.WriteLine("Streams are equal"); else { Console.WriteLine("Streams are not equal"); ISoundSource sourceOne = engine.AddSoundSourceFromIOStream(streamOne, "RandomName"); // I changed the sound name to some unique value, but I dont want to do that, because I see that Play2D(mp3AudioPath); Play2D(mp3AudioPath); works fine with same paths and doesnt give any errors ISoundSource sourceTwo = engine.AddSoundSourceFromIOStream(streamTwo, mp3AudioPath); // Error, not because streams are the same but because mp3AudioPath is the same. engine.Play2D(sourceOne, false, false, false); Thread.Sleep(3000); engine.Play2D(sourceTwo, false, false, false); // Plays the sound but its name is not the same as first and it gives "Unknown wave header in file" because file here is "RandomName" } Maybe IrrKlang just can not do that through Play2D(ISoundSource...) method? [/code][/quote]
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