> > Anyway I guess I'm asking if there is a way for you to preserve the sharing > of a sound file until it is necessary to create a unique instance of it, > and leave off all processing (clean!) until necessary, that would be great. > Well, I know it's a tall order.
I fear it's almost always necessary to create a unique instance: - when playing back a wave stream without any processing: would work - when playing back a compressed stream: need multiple SndFiles. - when playing back and sampling rate converting: need multiple SndFiles - when playing back and time stretching: need multiple. In the latter two cases, we anyway need a full instance of the stretcher/the SRC. > But maybe unnecessary, read on... > > I was just thinking, I seem to recall checking but can't remember > the results, if we tell libsndfile to open the same file twice (read) should > it > not give us two independent handles but internally just open the one file? > Manipulating handles (locate forward, reverse etc) would be independent > but economic, like any good file system? > So this might *negate* the need for our SndFileR. > The Copy On Write feature could still work here. > Hmm. Or were there problems with that concept. Did sndfile allow it. > Or was our SndFileR still required because of recording, or did we still > require reference counting. I can't recall ATM. > > Not to mention, opening and manipulating any file: Doesn't any smart > system, including libsndfile, buffer a small portion instead of loading > the entire thing into memory? i would expect that. And i would expect, that not libsndfile, but the operating system will take care to not open the same file multiple times, but instead give the same *file* descriptor (which is cheap anyway) and just a different *stream* descriptor (which is even cheaper). I'd also assume that seeking around all the time is worse than just opening the same file twice. So I'll remove SndFileR completely, and use SndFile as a plain C++ wrapper only. All actual interaction will happen through AudioStream, not SndFile directly any more. Greetings, flo ------------------------------------------------------------------------------ Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with <2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1 _______________________________________________ Lmuse-developer mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/lmuse-developer
