Skip to content

Commit

Permalink
all_Automation_Git_Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
AmolKadam-Tekdi committed Jul 15, 2024
1 parent 74a357c commit 85ebc21
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
6 changes: 4 additions & 2 deletions allAutomation/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion allAutomation/my_project/tests/BrowserManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
def setup():
# Initialize ChromeOptions
chrome_options = ChromeOptions()
chrome_options.add_argument('--headless') # Uncomment to run Chrome in headless mode?
# chrome_options.add_argument('--headless') # Uncomment to run Chrome in headless mode?
chrome_options.add_argument('--no-sandbox') # Bypass OS security model
chrome_options.add_argument('--disable-dev-shm-usage') # Overcome limited resource problems

Expand Down
Binary file not shown.
Binary file not shown.
17 changes: 12 additions & 5 deletions allAutomation/my_project/tests/microphoneSimulationTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import os
import base64
import shutil
import pyaudio
import wave


def logStep(step_description):
Expand Down Expand Up @@ -111,33 +113,38 @@ def test_microphone_simulation(setup):

def play_audio_through_microphone(audio_file):
# Construct the full path to the audio file
audio_file_path = "path_to_directory/output_audio.wav" # Replace with your actual path
audio_file_path = "output_audio.wav" # Replace with your actual path

# Open the WAV file for reading binary data
with wave.open(audio_file_path, 'rb') as wf:
# Instantiate PyAudio
p = pyaudio.PyAudio()

# Open a stream for input (microphone)
# Open a stream for output (playback)
stream = p.open(format=p.get_format_from_width(wf.getsampwidth()),
channels=wf.getnchannels(),
rate=wf.getframerate(),
input=True,
frames_per_buffer=1024)
output=True) # Set output=True for playback

# Read and play audio frames
data = wf.readframes(1024)
while data:
stream.write(data)
data = wf.readframes(1024)

# Close the input stream
# Close the output stream
stream.stop_stream()
stream.close()

# Terminate PyAudio
p.terminate()


# Example usage:
if __name__ == "__main__":
play_audio_through_microphone('output_audio.wav')


def speak_text(text):
from comtypes.client import CreateObject
engine = CreateObject("SAPI.SpVoice")
Expand Down

0 comments on commit 85ebc21

Please sign in to comment.