[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Joining two wave files
- From: Dirk Laurie <dpl@...>
- Date: Sun, 4 Sep 2011 18:09:41 +0200
On Sun, Sep 04, 2011 at 04:59:23PM +0200, Luciano de Souza wrote:
>
> I know to create the wave files, but I am not able to join them. I have
> never read binary files in Lua and I don't know how to do it.
It's this simple:
file1 = io.open("file1.wav","*a")
header1 = file1:sub(1,44)
body1 = file1:sub(45)
file2 = io.open("file2.wav","*a")
header2 = file2:sub(1,44)
body2 = file2:sub(45)
header3 = combine(header1,header2) -- you seem to know how
io.open("file3.wav","w"):write(header3..body1..body2)
Dirk