[audio] Spawn audio playing process using Start for async

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram 2016-05-14 16:42:33 -07:00
parent 7a966f0f39
commit b37c656ffe
3 changed files with 1 additions and 19 deletions

View File

@ -47,7 +47,7 @@ func (a *AudioAdaptor) Sound(fileName string) []error {
// command to play a MP3 file // command to play a MP3 file
cmd := exec.Command("mpg123", fileName) cmd := exec.Command("mpg123", fileName)
err = cmd.Run() err = cmd.Start()
if err != nil { if err != nil {
log.Println(err) log.Println(err)

View File

@ -2,7 +2,6 @@
package audio package audio
import ( import (
"os/exec"
"testing" "testing"
"github.com/hybridgroup/gobot/gobottest" "github.com/hybridgroup/gobot/gobottest"
@ -15,14 +14,5 @@ func TestAudioAdaptor(t *testing.T) {
gobottest.Assert(t, len(a.Connect()), 0) gobottest.Assert(t, len(a.Connect()), 0)
_, err := exec.LookPath("mpg123")
numErrsForTest := 0
if err != nil {
numErrsForTest = 1
}
gobottest.Assert(t, len(a.Sound("../resources/foo.wav")), numErrsForTest)
gobottest.Assert(t, len(a.Connect()), 0)
gobottest.Assert(t, len(a.Finalize()), 0) gobottest.Assert(t, len(a.Finalize()), 0)
} }

View File

@ -3,7 +3,6 @@
package audio package audio
import ( import (
"os/exec"
"testing" "testing"
"github.com/hybridgroup/gobot/gobottest" "github.com/hybridgroup/gobot/gobottest"
@ -18,11 +17,4 @@ func TestAudioDriver(t *testing.T) {
gobottest.Assert(t, len(d.Start()), 0) gobottest.Assert(t, len(d.Start()), 0)
gobottest.Assert(t, len(d.Halt()), 0) gobottest.Assert(t, len(d.Halt()), 0)
_, err := exec.LookPath("mpg123")
numErrsForTest := 0
if err != nil {
numErrsForTest = 1
}
gobottest.Assert(t, len(d.Sound("../resources/foo.mp3")), numErrsForTest)
} }