Converting video to mp3 in opencv

Hi Randy,
I am trying to convert an uploaded video file to audio(mp3)
I tried this code from your comments

f = st.file_uploader("Upload file")
tfile = tempfile.NamedTemporaryFile(delete=False)
tfile.write(f.read())

When I do this (1)

tfile.audio.write_audiofile("sample.mp3")

Or this (2)

tfile.name.audio.write_audiofile("sample.mp3")

But I am facing this error (1)

'_io.BufferedRandom' object has no attribute 'audio'

(2)

'str' object has no attribute 'audio'