Syntax: Select all
def playVideo(videoLink):
if not os.path.exists(songDir):
try:
os.mkdir(songDir)
except:
message("Couldn't create song dir!")
return
if len(os.listdir()) > 0:
for x in os.listdir():
os.remove(x)
else:
message('No songs to delete')
url = videoLink
video = pafy.new(url)
best = video.getbestaudio()
best.download()
song = os.listdir(songDir)[0]
message(song)
message(format("Playing {0} {1}".format(video.title, video.duration)))
for p in PlayerIter():
p.play_sound(song, video.duration)
Code: Select all
Boost.Python.ArgumentError: Python argument types in
_EngineSound.emit_sound(_EngineSound, RecipientFilter, int, Channel, str, str, Attenuation, SoundFlags, Pitch, Vector, Vector, tuple, bool, float, int)
did not match C++ signature:
emit_sound(class IEngineSound *, class MRecipientFilter {lvalue}, int, int, char const *, float, float, int flags=0, int pitch=100, class Vector const * origin=None, class Vector const * direction=None, class boost::python::tuple origins=(), bool update_positions=True, float sound_time=0.0, int speaker_entity=-1)
Parameter 6 (which is pitch) passes a string type to a float type. This parameter is responsible for the pitch.
https://github.com/ValveSoftware/source ... em.cpp#L89