5ca403cee17ee1e2a704e03bf06d47f2ce9ba222,examples/audio.py,,,#,33

Before Change


f.close()

with io.open("sound.wav", "rb") as f:
    x.text("Sending wave...")
    x.audio(f)

st.title("Audio from a URL")

After Change




avdir = os.path.expanduser("~")
audiofiles = get_audio_files_in_dir(avdir)

if len(audiofiles) == 0:
    st.write(
        "Put some audio files in your home directory (%s) to activate this player."
        % avdir
    )

else:
    filename = st.selectbox(
        "Select an audio file from your home directory (%s) to play" % avdir,
        audiofiles,
        0,
    )
    audiopath = os.path.join(avdir, filename)
    st.audio(audiopath)


st.header("Generated audio (440Hz sine wave)")


def note(freq, length, amp, rate):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: streamlit/streamlit
Commit Name: 5ca403cee17ee1e2a704e03bf06d47f2ce9ba222
Time: 2020-02-06
Author: naomi@nthmost.com
File Name: examples/audio.py
Class Name:
Method Name:


Project Name: wkentaro/labelme
Commit Name: 6117ec6153cd9e11192e98ca2dfbd1888574cff6
Time: 2018-04-14
Author: www.kentaro.wada@gmail.com
File Name: labelme/labelDialog.py
Class Name: LabelDialog
Method Name: postProcess


Project Name: wkentaro/labelme
Commit Name: 6117ec6153cd9e11192e98ca2dfbd1888574cff6
Time: 2018-04-14
Author: www.kentaro.wada@gmail.com
File Name: labelme/labelDialog.py
Class Name: LabelDialog
Method Name: validate