newbing吧 关注:35,611贴子:126,611
  • 3回复贴,共1
求助

大小姐原创歌曲

取消只看楼主收藏回复

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




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


    来自Android客户端2楼2023-04-14 21:53
    收起回复
      2026-05-03 20:04:53
      广告
      不感兴趣
      开通SVIP免广告


      来自Android客户端3楼2023-04-14 21:57
      回复
        千本樱
        ```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)
        ```


        来自Android客户端5楼2023-04-14 22:32
        回复