Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combiner: input_type not specified #85

Open
Viginox opened this issue Sep 1, 2018 · 4 comments
Open

Combiner: input_type not specified #85

Viginox opened this issue Sep 1, 2018 · 4 comments

Comments

@Viginox
Copy link

Viginox commented Sep 1, 2018

When using the combiner to build the output file, the Warning
WARNING:root:Input formats were only specified for 0 out of 2 files.The last 2 files will remain unformatted.
will be issued.
As far as I understood the working of combine.py this is because self.input_format is not supposed to be None due to the initialization

self.input_format = []

on line 58 in transform.py
and therefore the if condition

# Adjust length of input_format list
if input_format is None:
    fmts = [[] for _ in range(n_inputs)]

on line 392 in combine.py will never evaluate to True when being called from the build function

input_format_list = _build_input_format_list(
            input_filepath_list, input_volumes, self.input_format
)

( line 75 in combine.py )

Is this behavior on purpose?

@lostanlen
Copy link
Member

Hello! Thanks for reporting. What is the minimal code example you could provide that reproduces the issue?

@Viginox
Copy link
Author

Viginox commented Sep 3, 2018

I tested it with multiple file formats and also with all options for the Combiner.
(In my application I am using flac for both input files)

The minimal application would be as following:

import sox

cbn = sox.Combiner()
cbn.build([input_1, input_2], output_file, "mix-power")

I also tried to edit the code so this warning won't be displayed anymore, but I didn't know, if this behavior is intended.

My fix:

# Adjust length of input_format list
if input_format is None or input_format == []:

( line 392 in combine.py )

@spolezhaev
Copy link

spolezhaev commented Oct 12, 2018

Has the same issue. Obviously, it can be fixed by cbn.set_input_format(file_type=['wav', 'wav']) before build, but it works perfectly even without this line (showing this annoying message). Please add an option to suppress warning messages.

@jackkinsella
Copy link

Same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants