Page 1 of 2

Flowstone Audio Files project

Posted: Mon Nov 03, 2014 10:19 pm
by Exo
Hi guys,

I have recently been working on loading wave files via the DLL component and I have a working (I hope ;) ) prototype to share.

I have set up a Github Repository for this. It is all my own code I am not using any libraries or anything. This is a Netbeans project :twisted: , because I already use that IDE for java projects and it's just a great IDE :)

So why load wave files via the DLL component when we can already load them?

Well basically with this we can extract Cue Points and also playback Multi channel wave files up to 7 channels. It is restricted to 7 for practical reasons, more can be added.

This only supports PCM wave files at the moment but will be extended to support other file types in future.

Also I am outputting a min and max array for display purposes, this done in C++ is very fast and then in Flowstone all we need to do is display the arrays.

I still need to add write support, write support will enable us to add our own cue points as well as any addition data, for instance you could add a chunk for the base key of the sample.
This will open the door for creating our own file format, imagine saving all samples for each key and velocity of a sampler to one big file? That is also an aim of this project but will take a fair bit of work.

This is a very early version, optimizations are plenty in the schematic. Lot of improvements to make in the DLL.

Anyone with some C++ chops that fancies getting involved give me a shout!

Re: Wave file loading via DLL component

Posted: Mon Nov 03, 2014 11:20 pm
by tester
I like the project. Especially that future part that will allow to load files different than wav.

Re: Flowstone Audio Files project

Posted: Fri Nov 07, 2014 12:25 am
by Jay
Hi exo

ive tried your project m8 cheers for sharing that! :) but i could not get it to work, the dll component does not seem to load or see the dll file and it returns a false result for "Whether the dll was found" and "Whether the function was found in the dll",

no worky.png
no worky.png (15.65 KiB) Viewed 30394 times


I just have the dll file and the project in a folder on my desktop! im on win7 x64

I thought it was my firewall or something along those lines stopping it from working but nothing with all of my security stuff off either!

any ideas? would this be dependent on any runtimes or that?

great project though :)

Re: Flowstone Audio Files project

Posted: Fri Nov 07, 2014 1:19 am
by MyCo
The DLL is compiled non-static so it depends on 2 other DLLs (LIBSTDC++-6.DLL and LIBGCC_S_DW2-1.DLL). You can avoid that by adding the compiler switches -static -static-libgcc to the linker step.

I've build a wave reader for a wave player just one month ago. Although waves have a pretty easy format, there are so many types that you can work forever on this.

Re: Flowstone Audio Files project

Posted: Fri Nov 07, 2014 6:46 am
by Exo
@Jay thanks for check it out! I will try what Myco mentions and recompile the dll, I'll do that tonight.

Re: Flowstone Audio Files project

Posted: Fri Nov 07, 2014 6:53 am
by Exo
MyCo wrote:The DLL is compiled non-static so it depends on 2 other DLLs (LIBSTDC++-6.DLL and LIBGCC_S_DW2-1.DLL). You can avoid that by adding the compiler switches -static -static-libgcc to the linker step.

I've build a wave reader for a wave player just one month ago. Although waves have a pretty easy format, there are so many types that you can work forever on this.


Thanks Myco, yes there are many types of wav. My plan is to support the main ones in use.
I was also going to add support for MP3 but I have read there is patent issues, so I might just do that via Lame although I'm not really sure if that gets round the problem.

Re: Flowstone Audio Files project

Posted: Fri Nov 07, 2014 10:48 am
by tulamide
Exo wrote:I was also going to add support for MP3 but I have read there is patent issues, so I might just do that via Lame although I'm not really sure if that gets round the problem.

That's where it would be great if someone among us is a lawyer. In general, for everything encoding or decoding, you need a licence. Even if you make use of a third party product (LAME is especially noted). That would be $0.75 per unit, with a minimum of $15000 per year. This is how it was all the time.

On the other hand, there is this (bolded by myself):
"The initial near-complete MPEG-1 standard (parts 1, 2 and 3) was publicly available on 6 December 1991 as ISO CD 11172. In most countries, patents cannot be filed after prior art has been made public, and patents expire 20 years after the initial filing date, which can be up to 12 months later for filings in other countries. As a result, patents required to implement MP3 expired in most countries by December 2012, 21 years after the publication of ISO CD 11172."
If the patents expired I don't see that any licences would be needed anymore. But that could only be answered by a patent lawyer. Anyone?

Re: Flowstone Audio Files project

Posted: Fri Nov 07, 2014 11:30 am
by Exo
tulamide wrote:
Exo wrote:I was also going to add support for MP3 but I have read there is patent issues, so I might just do that via Lame although I'm not really sure if that gets round the problem.

That's where it would be great if someone among us is a lawyer. In general, for everything encoding or decoding, you need a licence. Even if you make use of a third party product (LAME is especially noted). That would be $0.75 per unit, with a minimum of $15000 per year. This is how it was all the time.

On the other hand, there is this (bolded by myself):
"The initial near-complete MPEG-1 standard (parts 1, 2 and 3) was publicly available on 6 December 1991 as ISO CD 11172. In most countries, patents cannot be filed after prior art has been made public, and patents expire 20 years after the initial filing date, which can be up to 12 months later for filings in other countries. As a result, patents required to implement MP3 expired in most countries by December 2012, 21 years after the publication of ISO CD 11172."
If the patents expired I don't see that any licences would be needed anymore. But that could only be answered by a patent lawyer. Anyone?


I will have to look into this properly, the version you state is old and maybe not fully compatible with recent versions? I don't know but that could be a problem.

It might be possible that I could add MP3 support and then the the user of the Library would be liable? And not me? Yes we need a lawyer :lol:

Re: Flowstone Audio Files project

Posted: Fri Nov 07, 2014 11:53 pm
by Exo
Jay wrote:Hi exo

ive tried your project m8 cheers for sharing that! :) but i could not get it to work, the dll component does not seem to load or see the dll file and it returns a false result for "Whether the dll was found" and "Whether the function was found in the dll",

no worky.png


I just have the dll file and the project in a folder on my desktop! im on win7 x64

I thought it was my firewall or something along those lines stopping it from working but nothing with all of my security stuff off either!

any ideas? would this be dependent on any runtimes or that?

great project though :)


I have updated the DLL with the static linker options, so hopefully this should work for you now :)

Re: Flowstone Audio Files project

Posted: Sat Nov 08, 2014 5:02 am
by tulamide
So, I've done a lot of research. Hours and hours of reading heavy technical patent descriptions. Here's my results. Let's start with a summary.

If you only decode mp3, the latest patent involved will expire on 22 September 2015.
If you encode mp3, the latest patent involved will expire on 16 April 2017.

That's good news. You will only support decoding, so if you don't publish your mp3 decoding option before September 2015 (only 10 months from now), you are free to do so. It will be in the public domain by then.

Here's the last patent involved in decoding mp3: http://patft1.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PALL&p=1&u=%2Fnetahtml%2FPTO%2Fsrchnum.htm&r=1&f=G&l=50&s1=5812672.PN.&OS=PN/5812672&RS=PN/5812672

And here the last one involved in encoding mp3: http://patft1.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PALL&p=1&u=%2Fnetahtml%2FPTO%2Fsrchnum.htm&r=1&f=G&l=50&s1=6009399.PN.&OS=PN/6009399&RS=PN/6009399

Oh my, I lost a day in my life researching this and my brain aged at least 10 years. And all of that reduced to 11 sentences in an off-topic post :lol: