精易论坛
标题:
Python-调用Bass音频库播放音乐
[打印本页]
作者:
大司命
时间:
2020-12-13 14:34
标题:
Python-调用Bass音频库播放音乐
#!/usr/bin/python
# -*- coding: utf-8 -*-
from ctypes import windll
from os import getcwd
from os.path import exists
if __name__ == '__main__':
filepath = getcwd() + r"\bass.dll"
if exists(filepath):
dll = windll.LoadLibrary(filepath)
dll.BASS_Init(-1, 44100, 0, None, None)
handle = dll.BASS_StreamCreateFile(False, r"F:\KuGou\何晟铭&杜淳 - 爱的供养(男声合唱版).mp3".encode("gbk"), None, None, 0)
dll.BASS_ChannelPlay(handle, False)
pos = dll.BASS_ChannelGetLength(handle, 0)
while dll.BASS_ChannelGetPosition(handle, 0) != pos:
pass
dll.BASS_Free()
复制代码
bass.zip
(149.53 KB, 下载次数: 32)
2020-12-13 14:24 上传
点击文件名下载附件
下载积分: 精币 -2 枚
Python-调用Bass音频库播放音乐
https://bbs.266.la/forum.php?mod=viewthread&tid=514
(出处: 派生社区)
作者:
果心豆腐酱
时间:
2020-12-13 16:32
这论坛还有phthon的吗
作者:
禾子
时间:
2020-12-27 15:42
如果有更详细的注释就更方便理解了
作者:
yuzhong
时间:
2023-11-6 17:08
11111111111111111111111111
作者:
yuzhong
时间:
2025-4-6 00:39
11111111111111111111111111
作者:
yuzhong
时间:
2025-4-15 10:11
111111111111111111111111111
欢迎光临 精易论坛 (https://125.confly.eu.org/)
Powered by Discuz! X3.4