Click here to Skip to main content
15,914,795 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a real recorded signal in the .wav file. I want to find the start and end time or just the start time of data processing in the signal. I have a noisy real signal that is flowing on the air recorded in the .wav file. How to do it?

What I have tried:

#adjust target amplitude
def match_target_amplitude(sound, target_dBFS):
change_in_dBFS = target_dBFS - sound.dBFS
return sound.apply_gain(change_in_dBFS)

#Convert wav to audio_segment
audio_segment = AudioSegment.from_wav("test1.wav")

#normalize audio_segment to -20dBFS
normalized_sound = match_target_amplitude(audio_segment, -20.0)
print("length of audio_segment={} seconds".format(len(normalized_sound)/1000))

#Print detected non-silent chunks, which in our case would be spoken words.
nonsilent_data = detect_nonsilent(normalized_sound, min_silence_len=500, silence_thresh=-20, seek_step=1)

#convert ms to seconds
print("start,Stop")
for chunks in nonsilent_data:
print( [chunk/1000 for chunk in chunks])

I want to use the same idea for the real signals flowing in the air too. Is it possible to find the start and end time or just the start time of real signal processing?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900