pip install baidu-aip
# from aip import AipSpeech
# """ 你的 APPID AK SK """
# APP_ID = '1470334'
# API_KEY = 'Mjs4QCgqoQYG84d5zEc2EUsj'
# SECRET_KEY = 'wE5rAHHXfQKm1b06AZ6LaQrmV2ymVAiW'
#
# client = AipSpeech(APP_ID, API_KEY, SECRET_KEY)
# result = client.synthesis('i love my mother', 'zh', 1, {
# 'vol': 5, 'per': 4
# })
#
# # 识别正确返回语音二进制 错误则返回dict 参照下面错误码
# if not isinstance(result, dict):
# with open('auido.mp3', 'wb') as f:
# f.write(result)
import pygame
pygame.mixer.init()
pygame.mixer.music.load(r'D:\Program Files (x86)\dj_03\Kalimba.mp3')
pygame.mixer.music.play()