2015-08-12 02:06:00 +00:00
|
|
|
package tta
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestDecompress(t *testing.T) {
|
2017-04-19 02:47:35 +00:00
|
|
|
t.Parallel()
|
2015-08-12 02:06:00 +00:00
|
|
|
infile, err := os.Open("./data/sample.tta")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2015-08-14 15:29:33 +00:00
|
|
|
defer infile.Close()
|
2015-08-12 02:06:00 +00:00
|
|
|
outfile, err := os.Create(os.TempDir() + "/sample_decompressed.wav")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2015-08-14 15:29:33 +00:00
|
|
|
defer outfile.Close()
|
2015-08-19 10:29:06 +00:00
|
|
|
defer os.Remove(os.TempDir() + "/sample_decompressed.wav")
|
2015-08-12 12:30:48 +00:00
|
|
|
if err = Decompress(infile, outfile, "", nil); err != nil {
|
2015-08-12 02:06:00 +00:00
|
|
|
t.Error(err)
|
|
|
|
}
|
|
|
|
}
|