Refactor: audio_helper - Move command utilities to cmd_utils.py.
BUG=None
TEST=Run audiovideo_CRASFormatConversion on parrot
Change-Id: I3950c91d904230090fb77a5f42f29084bad5d1e6
Reviewed-on: https://chromium-review.googlesource.com/178372
Reviewed-by: Owen Lin <owenlin@chromium.org>
Tested-by: Owen Lin <owenlin@chromium.org>
Commit-Queue: Owen Lin <owenlin@chromium.org>
diff --git a/client/cros/audio/cras_utils.py b/client/cros/audio/cras_utils.py
index 92279e6..d99c157 100644
--- a/client/cros/audio/cras_utils.py
+++ b/client/cros/audio/cras_utils.py
@@ -6,7 +6,7 @@
import re
from autotest_lib.client.bin import utils
-from autotest_lib.client.cros.audio import audio_helper
+from autotest_lib.client.cros.audio import cmd_utils
_CRAS_TEST_CLIENT = '/usr/bin/cras_test_client'
_RE_SELECTED_OUTPUT_NODE = re.compile('Selected Output Node: (.*)')
@@ -14,11 +14,11 @@
def playback(*args, **kargs):
"""A helper function to execute the playback_cmd."""
- audio_helper.execute(playback_cmd(*args, **kargs))
+ cmd_utils.execute(playback_cmd(*args, **kargs))
def capture(*args, **kargs):
"""A helper function to execute the capture_cmd."""
- audio_helper.execute(capture_cmd(*args, **kargs))
+ cmd_utils.execute(capture_cmd(*args, **kargs))
def playback_cmd(playback_file, buffer_frames=None, duration=None, rate=44100):
"""Gets a command to playback a file with given settings.
@@ -61,7 +61,7 @@
"""
args = [_CRAS_TEST_CLIENT]
args += ['--volume', str(volume)]
- audio_helper.execute(args)
+ cmd_utils.execute(args)
def set_node_volume(node_id, volume):
"""Set the volume of the given output node.
@@ -71,7 +71,7 @@
"""
args = [_CRAS_TEST_CLIENT]
args += ['--set_node_volume', '%s:%d' % (node_id, volume)]
- audio_helper.execute(args)
+ cmd_utils.execute(args)
def set_capture_gain(gain):
"""Set the system capture gain.
@@ -79,7 +79,7 @@
"""
args = [_CRAS_TEST_CLIENT]
args += ['--capture_gain', str(gain)]
- audio_helper.execute(args)
+ cmd_utils.execute(args)
def dump_server_info():
"""Gets the CRAS's server information."""