2010-09-09 37 views
13

Tôi muốn xóa giọng hát khỏi các bản nhạc mp3. Tôi đã tìm kiếm trên google và đã thử vài phần mềm nhưng không có phần mềm nào trong số đó thuyết phục được. Tôi đang lập kế hoạch để đọc các tập tin mp3, có được một dạng sóng và loại bỏ các dạng sóng đó là trên một giới hạn quy định.Thuật toán để xóa giọng hát khỏi bản âm thanh

bạn có bất kỳ đề xuất nào về cách tiếp tục không.

- Cập nhật

Tôi chỉ muốn mã có thể đọc định dạng tệp mp3. Có phần mềm nào không ??

+0

Đây sẽ là khá mát mẻ ... những gì các phần mềm anh đã thử? – sholsapp

+0

audacity, wavosaur và extra boy pro – Boolean

Trả lời

14

Đây không phải là quá nhiều "thuật toán" như một "thủ thuật" nhưng nó có thể được tự động hóa trong mã. Nó hoạt động chủ yếu cho các bản nhạc stereo với giọng hát được đặt ở giữa. Nếu giọng hát là trung tâm, chúng biểu hiện như nhau trong cả hai bài hát. Nếu bạn đảo ngược một trong các bài hát và sau đó hợp nhất chúng lại với nhau, các dạng sóng của giọng hát trung tâm sẽ bị hủy bỏ và hầu như bị loại bỏ. Bạn có thể làm điều này bằng tay với hầu hết các trình chỉnh sửa âm thanh tốt như audacity. Nó không cung cấp cho bạn kết quả hoàn hảo và phần còn lại của âm thanh bị một chút quá nhưng nó làm cho bài hát karaoke tuyệt vời :)

+4

Nó được gọi là hủy pha, hạn chế chính là bản nhạc được tạo là mono. – arul

+0

> "phần còn lại của âm thanh cũng bị quá" - trường hợp may mắn này hiếm khi xảy ra. trường hợp có thể xảy ra nhất là có ít âm thanh còn lại và nó cũng có vẻ rất sai. tuy nhiên, thường có thể làm được điều gì đó tốt hơn nếu có nguồn âm thanh nổi hơn (5.1, v.v.). nhưng nó cũng không đơn giản là –

0

Trên một giới hạn được chỉ định? âm thanh như một bộ lọc thông cao ... Bạn có thể sử dụng hủy bỏ giai đoạn nếu bạn đã theo dõi acapella cùng với bản gốc. Nếu không, trừ khi một ca khúc 60 tuổi cũ có giọng hát trực tiếp ở giữa và mọi thứ khác cứng rắt, tôi không nghĩ rằng có một cách siêu sạch để loại bỏ giọng hát.

+1

là có cách nào bạn biết để tách âm thanh khác nhau của âm thanh đầu vào? tôi có nghĩa là ví dụ thuật toán cho chúng ta ví dụ 100 âm thanh được tìm thấy khác nhau và để lại những âm thanh cụ thể cho chúng ta được loại bỏ. – ConductedClever

+0

@ConductedClever: https://en.wikipedia.org/wiki/Independent_component_analysis – user

+0

Hoặc, nói chung, https://en.wikipedia.org/wiki/Blind_signal_separation – user

8

Nguồn: http://www.cdf.utoronto.ca/~csc209h/summer/a2/a2.html, được viết bởi Daniel Zingaro.

Sounds are waves of air pressure. When a sound is generated, a sound wave consisting of compressions (increases in pressure) and rarefactions (decreases in pressure) moves through the air. This is similar to what happens if you throw a stone into a pond: the water rises and falls in a repeating wave.

When a microphone records sound, it takes a measure of the air pressure and returns it as a value. These values are called samples and can be positive or negative corresponding to increases or decreases in air pressure. Each time the air pressure is recorded, we are sampling the sound. Each sample records the sound at an instant in time; the faster we sample, the more accurate is our representation of the sound. The sampling rate refers to how many times per second we sample the sound. For example, CD-quality sound uses a sampling rate of 44100 samples per second; sampling someone's voice for use in a VOIP conversation uses far less than this. Sampling rates of 11025 (voice quality), 22050, and 44100 (CD quality) are common...

For mono sounds (those with one sound channel), a sample is simply a positive or negative integer that represents the amount of compression in the air at the point the sample was taken. For stereo sounds (which we use in this assignment), a sample is actually made up of two integer values: one for the left speaker and one for the right...

Here's how the algorithm [to remove vocals] works.

  • Copy the first 44 bytes verbatim from the input file to the output file. Those 44 bytes contain important header information that should not be modified.

  • Next, treat the rest of the input file as a sequence of shorts. Take each pair of shorts left and right, and compute combined = (left - right) /2. Write two copies of combined to the output file.

Why Does This Work?

For the curious, a brief explanation of the vocal-removal algorithm is in order. As you noticed from the algorithm, we are simply subtracting one channel from the other (and then dividing by 2 to keep the volume from getting too loud). So why does subtracting the left channel from the right channel magically remove vocals?

When music is recorded, it is sometimes the case that vocals are recorded by a single microphone, and that single vocal track is used for the vocals in both channels. The other instruments in the song are recorded by multiple microphones, so that they sound different in both channels. Subtracting one channel from the other takes away everything that is ``in common'' between those two channels which, if we're lucky, means removing the vocals.

Of course, things rarely work so well. Try your vocal remover on this badly-behaved wav file . Sure, the vocals are gone, but so is the body of the music! Apparently, some of the instruments were also recorded "centred", so that they are removed along with the vocals when channels are subtracted.

+0

bạn đã thử cái này chưa? – ConductedClever

+0

Không, tôi chỉ kiểm tra lớp học vì vậy tôi không phải làm vậy. Có vẻ như liên kết không hoạt động nữa ... – Daniel

+1

Các tệp WAV là các tệp RIFF có một hoặc nhiều phần WAVE. Sửa đổi các tập tin theo cách này có thể phá vỡ các tập tin với nhiều phần WAVE và cũng sẽ clobber các bộ phận khác như INFO và thẻ ID3. – meklarian

4

Bạn có thể sử dụng hộp công cụ pydub, xem here để biết chi tiết, cũng thấy here cho câu hỏi có liên quan. Nó phụ thuộc vào FFmpeg và có thể đọc bất kỳ fileformat

Sau đó, bạn có thể làm như sau:

from pydub import AudioSegment 
from pydub.playback import play 

# read in audio file and get the two mono tracks 
sound_stereo = AudioSegment.from_file(myAudioFile, format="mp3") 
sound_monoL = sound_stereo.split_to_mono()[0] 
sound_monoR = sound_stereo.split_to_mono()[1] 

# Invert phase of the Right audio file 
sound_monoR_inv = sound_monoR.invert_phase() 

# Merge two L and R_inv files, this cancels out the centers 
sound_CentersOut = sound_monoL.overlay(sound_monoR_inv) 

# Export merged audio file 
fh = sound_CentersOut.export(myAudioFile_CentersOut, format="mp3") 
+0

Làm cách nào để xóa các trung tâm kết quảTừ gốc. –

Các vấn đề liên quan