2015-08-19 03:19:51 +00:00
|
|
|
package tta
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestCompress(t *testing.T) {
|
2017-04-19 02:47:35 +00:00
|
|
|
t.Parallel()
|
2015-08-19 03:19:51 +00:00
|
|
|
infile, err := os.Open("./data/sample.wav")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
defer infile.Close()
|
|
|
|
outfile, err := os.Create(os.TempDir() + "/sample_compressed.tta")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
defer outfile.Close()
|
2015-08-19 10:29:06 +00:00
|
|
|
defer os.Remove(os.TempDir() + "/sample_compressed.tta")
|
2015-08-19 03:19:51 +00:00
|
|
|
if err = Compress(infile, outfile, "", nil); err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
}
|
|
|
|
}
|