voicerecorder

package
v0.0.0-...-683b059 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package voicerecorder wraps method and constant of voice recorder app for MTBF testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VoiceRecorder

type VoiceRecorder struct {
	// contains filtered or unexported fields
}

VoiceRecorder creates a struct that contains *apputil.App

func New

New returns an instance of VoiceRecorder.

func (*VoiceRecorder) AppName

func (vr *VoiceRecorder) AppName() string

AppName returns the name of voice recorder app.

func (*VoiceRecorder) Close

func (vr *VoiceRecorder) Close(ctx context.Context, cr *chrome.Chrome, hasError func() bool, outDir string) error

Close closes voice recorder app.

func (*VoiceRecorder) DeleteAudio

func (vr *VoiceRecorder) DeleteAudio(fileName string) error

DeleteAudio deletes the audio file created by RecordSound method. The file deletion functionality provide by Voice Recorder might comes with ads show up, to avoid dealing with ads, here delete those files by os.Remove().

func (*VoiceRecorder) Launch

func (vr *VoiceRecorder) Launch(ctx context.Context) error

Launch installs app first if the app doesn't exist. And then launches app.

func (*VoiceRecorder) PlayFile

func (vr *VoiceRecorder) PlayFile(fileName string) uiauto.Action

PlayFile plays a specified file.

func (*VoiceRecorder) RecordAudio

func (vr *VoiceRecorder) RecordAudio(ctx context.Context) (string, error)

RecordAudio clicks on record button to record audio and returns the name of recorded file.

func (*VoiceRecorder) UpdateOutDir

func (vr *VoiceRecorder) UpdateOutDir(ctx context.Context) error

UpdateOutDir updates the output directory from default to downloads.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL