我想将音频文件分段5秒(每个分段),我想将每个分段发送到google语音API,以识别音频文本,还希望在此期间执行其他一些操作。
import pygame
import time
pygame.mixer.init()
pygame.init()
pygame.mixer.set_num_channels(26)
sound1 = pygame.mixer.Sound("sound1.ogg")
sound2 = pygame.mixer.Sound("sound2.ogg")
sound1.play(loops = -1)
time.sleep (2)
sound2.play(loop = -1)