Import without drag and drop?

When I right-click an audio file, Audacity is one of the many options I’m presented with, but using this always opens a new Audacity window, regardless of whether I have an instance of Audacity already running. This is understandable, but it isn’t always a good fit with how I use Audacity. In cases like these, I usually want to add the file I clicked on to the existing Audacity instance as an additional track (or pair of tracks). I know I can do this by dragging the new file into the existing window, but this is frequently difficult because of many other open windows in the way. Is there any way I can set up something in the right-click menu that will automatically target the existing Audacity window without my needing to use drag and drop?

File > Import. You can select multiple files that way and they all appear in one window (one above the other).

Koz

As koz says, either “File menu > Import > Audio”,
(or, drag the audio file into the Audacity window).

Audacity does not set up file associations other than with Audacity projects (as you have discovered, that has limited usefulness), so I presume that you set up file associations with some types of audio files yourself.

Yes, and I’m looking for a command line / registry entry that’ll let me import a file into a running instance of Audacity from Explorer without having to drag and drop - if such a thing could exist. (File | Import is also less than optimal for me because usually I find File 1 in Explorer, import it into Audacity, find File 2 in Explorer, and want to avoid having to leave Explorer to get File 2 into Instance 1 of Audacity.)

You can use the following syntax after either opening a command prompt or by entering the command into the Explorer address bar:

<path to audacity.exe> file1.wav file2.wav

or whatever file type it is.

The path must be inside quotes if the path contains spaces.

If you have already navigated in the prompt or Explorer to the Audacity directory then it is just

audacity file1.wav file2.wav

Once Audacity is open, the files following each “audacity” command will import into the same window.


Gale

This is not happening on my system (x64 Windows 8.1). Irrespective of whether Audacity is already open or not, if I use “ file1.wav file2.wav”, each WAV file opens in a separate instance of Audacity (two buttons on the Windows Taskbar). On the other hand, if I use “Ctrl+Shift+I” (File | Import > Audio), both files are opened in a single instance of Audacity (one button on the Windows Taskbar).
It would be good if there was a command-line to “import” several audio files into a single instance of Audacity.

Which version of Audacity are you using, Robert? It should work in the latest 2.1.0-alpha. It won’t work in older 2.1.0-alphas, and in 2.0.6, files after the first don’t even get passed to Audacity.

And to clarify, they are not separate instances of Audacity. It is the same instance of audacity.exe in Task Manager, running two windows.

That “should” now be working as I described. I have not tried in Win 8.1, but I don’t see why it should be different there.


Gale

I am using the Nightly Alpha builds (for the WDM-KS support). But I don’t think it should make any difference regarding the command-line.

Gale, you are right, if I use “ file1.wav file2.wav”, it is the same instance of audacity.exe in Task Manager, but Audacity is running two windows.

What I meant is that “Ctrl+Shift+I” creates only one Audacity window, and the imported files are displayed on top of each other within the same Audacity “window” (GUI). Editing two or several files together is much easier that way.

What can be achieved through “Ctrl+Shift+I” cannot be achieved from the command-line.

By the way, the Audacity Alpha builds are extremely stable on my system (x64 Windows 8.1 with integrated Realtek Audio). I have a question that is probably unsuited for this forum, but the latest Alpha Build has dropped support for WDM-KS (at least on my system). Is this by design, and is it final?

I did know what you meant, Robert. For me on Windows 7, once Audacity is open, audacity file1.wav file2.wav imports both files into one new project window.

But might you have turned off the warning for uncompressed audio files, or you’re importing other than WAV or AIFF? I agree in that case that each file will open into its own new window, which I had not realised. I guess this could be happening because the warning dialogue “disrupts” the normal file opening process.

Yes I agree it would be nice for the command-line to have an explicit import option as opposed to open, rather than import working as a fluke when the warning dialogue appears. So I’ll move this to “Adding Features”.

Unless you connect the HDMI output in WDM-KS enabled builds? :wink:

It will be turned on again for alpha builds after 2.1.0 is released.


Gale

This is on x64 Windows 8.1 with all updates. And Audacity Alpha Build released on January 12.

I had previously tried the command-line with 2 FLAC files. Each FLAC file had opened into its own new window with no warning message.

I just tried the same command-line with 2 WAV files this time. I got a warning message about uncompressed files for each of them. They both opened on top of each other within a single Audacity window. Something funny to report though. When I selected the FLAC file that was open on top, it had its title displaying on the Audacity own title bar. But when I selected the FLAC file that was open beneath it, the Audacity title bar kept displaying the name of the now unselected top file. Maybe Audacity is designed so that it always displays the name of the top file in its own title bar? This could be quite confusing at times …

Note that a command-line that would import files on top of each other into a single Audacity window would be helpful to create a most practical shortcut in the Windows SendTo folder. We could select several audio files, right-click the selection, and choose “SendTo > Audacity”. This would spare having to write the command-line.

You are right regarding the HDMI output. If I select the HDMI output to my screen speakers (which I never do because they produce awful sound), neither Audacity nor Windows crash, but Audacity only records white noise through WDM-KS.

However, WDM-KS is working fine if I output to the external speakers.

Yes Audacity names the project according to the name of the first imported file - if you import files simultaneously the first file is the first file in alphanumerical order.


Gale

I apologize for not checking the status of this thread sooner.

Frankly, from my perspective, whether these windows are controlled by one master task or multiple tasks is irrelevant. What I’m looking for is a command-line way to add files to an already open Audacity window (the topmost one in the Z-order, for the sake of argument when there’s more than one - but I hardly ever have more than one) without opening another window (unless there’s no Audacity window currently open).

And that’s essentially the problem that I was looking to solve when I started this thread - sort of. Ctrl-Shift-I results in a dialog box being opened, for me to navigate to the file I want to import - but why should I have to do this again when I’ve already navigated to it in an Explorer window? The work order seems backward here: “First, tell me that you want to import a file, then tell me which file you want to import” doesn’t work well for me.

Yes, but it’s a new project window; I want a way to get the file(s) into the existing window.

So I take it there’s currently no way to make Audacity do what I want. That’s okay - I’m used to it (see below).

My understanding is that the name in the title bar is the name of the .aup file (or rather, the name that would be used by default if you decided to save your work as an .aup file, which I don’t recall ever actually needing to do). This is similar to the confusion that can arise with MP3 tags when multiple MP3s are imported. I’ve written about that before.

The thing is that Audacity is purposefully and unashamedly designed for editing audio in a graphical environment.
For editing audio in a command line environment there are other applications designed for that purpose (such as SoX).

Of course, at the core of Audacity it is all about number crunching, and it IS possible to operate Audacity from a command line environment with very few limitations. Just as it is possible to drive a car remotely via radio control (subject to either modifying the car or using additional radio controlled gizmos to operate the normal controls), so it is possible to operate Audacity “remotely” via the command line (subject to either modifying Audacity or using a third party tools to convert command line arguments into keystroke commands). One way that Audacity can be controlled via the command line is to build Audacity from the source code and include the “Scripting” module “mod-script-pipe”. This module allows commands from any scripting language that supports “named pipes” (such as Python) to send commands to Audacity’s command handler. There is some information about mod-script-pipe in the Audacity wiki: http://manual.audacityteam.org/man/Scripting

Right, but you did not reply to https://forum.audacityteam.org/t/inconsistency-with-import-export-behavior/32721/8 about exactly what you wanted to vote for, so no vote was counted.

I’ll be quite open in saying that in my opinion Audacity is dropping behind in not implementing improvements to import and export. There are a few code refactoring obstacles to some improvements. The developers know my view and I will continue to keep import and export on the agenda. However there are some major new features in the next few upcoming releases that will probably push import/export down the agenda.

As usual with open source, a lot depends on what the current developers are motivated to implement. A number of the current developers are interested in glamorous scientific features like spectrograms and filter processing. If we attract some developers who are prepared to expound repeatedly the case for a makeover for bread and butter but important features like import and export and the closely related Chains feature, you may get some of your wishes.


Gale