90780bfa782b6c4fa0cac0cda10210d162fb516d,librosa/core/audio.py,,stream,#,213
Before Change
sr = sf.info(path).samplerate
// Construct the stream
block_stream = __stream(path, sr, block_length, frame_length, hop_length,
mono, offset, duration, fill_value, dtype)
return block_stream, sr
def __stream(path, sr, block_length, frame_length, hop_length,
mono, offset, duration, fill_value, dtype):
After Change
start = 0
if duration:
frames = int(duration * sr)
else:
frames = -1
blocks = sf.blocks(path,
blocksize=frame_length + (block_length - 1) * hop_length,
overlap=frame_length - hop_length,
fill_value=fill_value,
start=start,
frames=frames,
dtype=dtype,
always_2d=False)
for block in blocks:
if mono:
yield to_mono(block.T)
else:
yield block.T
@cache(level=20)
def to_mono(y):
"""Force an audio signal down to mono.
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: librosa/librosa
Commit Name: 90780bfa782b6c4fa0cac0cda10210d162fb516d
Time: 2019-06-21
Author: brian.mcfee@nyu.edu
File Name: librosa/core/audio.py
Class Name:
Method Name: stream
Project Name: librosa/librosa
Commit Name: 3c382e94cf3a01f73bf96837eb6428b118555569
Time: 2019-05-04
Author: brian.mcfee@nyu.edu
File Name: librosa/core/audio.py
Class Name:
Method Name: stream
Project Name: coala/coala-bears
Commit Name: bfd61fb7a0c4456ce812a227f3b1962b2c727879
Time: 2016-09-03
Author: abdealikothari@gmail.com
File Name: bears/general/KeywordBear.py
Class Name: KeywordBear
Method Name: run