newbing吧 关注:36,505贴子:124,714
  • 8回复贴,共1
求助

大小姐原创歌曲

只看楼主收藏回复

⑧U知道这个怎么转成mp3吗




IP属地:陕西来自Android客户端1楼2023-04-14 21:49回复
    修玛吉亚也是有梦想的(bushi)


    IP属地:陕西来自Android客户端2楼2023-04-14 21:53
    收起回复


      IP属地:陕西来自Android客户端3楼2023-04-14 21:57
      回复
        用MML输出试试


        IP属地:河南来自Android客户端4楼2023-04-14 22:12
        收起回复
          千本樱
          ```python
          # This is a song in the style of Hatsune Miku and Kuro Usa-P
          # It uses pydub library to manipulate audio files
          # You need to install pydub first: pip install pydub
          # Then save this file as [p]网页链接 and run it in the command line: python [p]网页链接 # It will generate a file called song.mp3 that you can play with any player
          # If you can't hear the sound or have any errors, please let me know
          from pydub import AudioSegment
          from [p]网页链接 import play
          from [p]网页链接 import Sine
          # Load the instrumental track from a file
          instrumental = AudioSegment.from_file("instrumental.mp3")
          # Create a sine wave generator for the vocal track
          sine = Sine(440)
          # Define the notes and durations for the vocal melody
          notes = [440, 494, 523, 587, 659, 698, 784, 880] # A4, B4, C5, D5, E5, F5, G5, A5 in Hz
          durations = [500, 250, 250, 500, 250, 250, 500, 500] # in milliseconds
          # Create an empty vocal track
          vocal = AudioSegment.empty()
          # Loop through the notes and durations and append the corresponding sine waves to the vocal track
          for note, duration in zip(notes, durations):
          [p]网页链接 = note # set the frequency of the sine wave
          vocal += sine.to_audio_segment(duration) # convert the sine wave to an audio segment and append it
          # Adjust the volume of the vocal track
          vocal = vocal - 10 # reduce by 10 dB
          # Mix the instrumental and vocal tracks together
          song = instrumental.overlay(vocal)
          # Export the song to a file
          song.export("song.mp3", format="mp3")
          # Play the song (optional)
          play(song)
          ```


          IP属地:陕西来自Android客户端5楼2023-04-14 22:32
          回复
            一个py文件是怎么生成mp3的,总不能数据存在py文件里吧,感觉不靠谱


            IP属地:重庆来自Android客户端7楼2023-04-14 22:38
            回复