Csound Csound-dev Csound-tekno Search About

[Csnd] Android Csound Question

Date2022-07-15 22:27
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
Subject[Csnd] Android Csound Question
Does anyone recall what used to be the path for an audio output file (.wav) on earlier versions of Android Csound? (I'm talking about the filename used with fout , essentially recording a real-time performance)

The current required full pathname - /storage/emulated/0/Music/ - doesn't work with versions earlier than Michael's current Csound for Android on play.google.com. (CsdPlayer is a good example of such an earlier version; there were many of these, including a number of late Csound5 and 6.01 versions that my son and I came up with, and that are available on my website)

Neither does a simple filename work, or something like /Music/ .

Or was perhaps writing a .wav not an option with earlier versions?

I've tried many earlier versions on the same fairly recent Android smartphone. I'd like to create Android .csd's that will run on any recent Android device, but including earlier editions of Android Csound which all have somewhat different features - especially different GUIs (i.e, numbers of performance controls).
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2022-07-15 23:58
Fromthorin kerr
SubjectRe: [Csnd] Android Csound Question
On an old tablet, I have /sdcard/Music listed in the 'Output directory', in the settings in the app (6.14).



On Sat, 16 July 2022, 7:28 am Arthur Hunkins, <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
Does anyone recall what used to be the path for an audio output file (.wav) on earlier versions of Android Csound? (I'm talking about the filename used with fout , essentially recording a real-time performance)

The current required full pathname - /storage/emulated/0/Music/ - doesn't work with versions earlier than Michael's current Csound for Android on play.google.com. (CsdPlayer is a good example of such an earlier version; there were many of these, including a number of late Csound5 and 6.01 versions that my son and I came up with, and that are available on my website)

Neither does a simple filename work, or something like /Music/ .

Or was perhaps writing a .wav not an option with earlier versions?

I've tried many earlier versions on the same fairly recent Android smartphone. I'd like to create Android .csd's that will run on any recent Android device, but including earlier editions of Android Csound which all have somewhat different features - especially different GUIs (i.e, numbers of performance controls).
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2022-07-18 09:37
FromJacques Leplat
SubjectRe: [Csnd] Android Csound Question

Hello Art,


I've had a look at some of my old code, and found these:

import android.os.Environment;
File file = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_RINGTONES);
dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
if (dir == null) {
    dir = new File("/mnt/sdcard");
}

The old, old Android location /mnt/sdcard worked on old Android versions, but not newer ones, which use the Environment constants. It is quite possible that it has all been changed again by the busy Android team, in the name of "progress", worth a try if you're stuck though.

Reading and writing files needs the appropriate manifest entries too (in AndroidManifest.xml), I used:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

I think this manifest entry has been changed and may no longer work on more modern Android releases. It's been a good few years since I did Android coding: I gave up wasting my time trying to keep up with the changes they introduce, and now focus on more productive endeavours.


Good luck,


Jacques

On 15/07/2022 22:27, Arthur Hunkins wrote:
Does anyone recall what used to be the path for an audio output file (.wav) on earlier versions of Android Csound? (I'm talking about the filename used with fout , essentially recording a real-time performance)

The current required full pathname - /storage/emulated/0/Music/ - doesn't work with versions earlier than Michael's current Csound for Android on play.google.com. (CsdPlayer is a good example of such an earlier version; there were many of these, including a number of late Csound5 and 6.01 versions that my son and I came up with, and that are available on my website)

Neither does a simple filename work, or something like /Music/ .

Or was perhaps writing a .wav not an option with earlier versions?

I've tried many earlier versions on the same fairly recent Android smartphone. I'd like to create Android .csd's that will run on any recent Android device, but including earlier editions of Android Csound which all have somewhat different features - especially different GUIs (i.e, numbers of performance controls).
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2022-07-18 13:54
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] Android Csound Question
Thanks, Thorin. /sdcard/Music works!

On Fri, Jul 15, 2022 at 6:59 PM thorin kerr <thorin.kerr@gmail.com> wrote:
On an old tablet, I have /sdcard/Music listed in the 'Output directory', in the settings in the app (6.14).



On Sat, 16 July 2022, 7:28 am Arthur Hunkins, <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
Does anyone recall what used to be the path for an audio output file (.wav) on earlier versions of Android Csound? (I'm talking about the filename used with fout , essentially recording a real-time performance)

The current required full pathname - /storage/emulated/0/Music/ - doesn't work with versions earlier than Michael's current Csound for Android on play.google.com. (CsdPlayer is a good example of such an earlier version; there were many of these, including a number of late Csound5 and 6.01 versions that my son and I came up with, and that are available on my website)

Neither does a simple filename work, or something like /Music/ .

Or was perhaps writing a .wav not an option with earlier versions?

I've tried many earlier versions on the same fairly recent Android smartphone. I'd like to create Android .csd's that will run on any recent Android device, but including earlier editions of Android Csound which all have somewhat different features - especially different GUIs (i.e, numbers of performance controls).
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2022-07-18 13:55
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] Android Csound Question
Thanks for your research, Jacques. Thorin's suggestion of /sdcard/Music did the trick for me.

On Mon, Jul 18, 2022 at 4:37 AM Jacques Leplat <jleplat@j3ltd.com> wrote:

Hello Art,


I've had a look at some of my old code, and found these:

import android.os.Environment;
File file = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_RINGTONES);
dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
if (dir == null) {
    dir = new File("/mnt/sdcard");
}

The old, old Android location /mnt/sdcard worked on old Android versions, but not newer ones, which use the Environment constants. It is quite possible that it has all been changed again by the busy Android team, in the name of "progress", worth a try if you're stuck though.

Reading and writing files needs the appropriate manifest entries too (in AndroidManifest.xml), I used:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

I think this manifest entry has been changed and may no longer work on more modern Android releases. It's been a good few years since I did Android coding: I gave up wasting my time trying to keep up with the changes they introduce, and now focus on more productive endeavours.


Good luck,


Jacques

On 15/07/2022 22:27, Arthur Hunkins wrote:
Does anyone recall what used to be the path for an audio output file (.wav) on earlier versions of Android Csound? (I'm talking about the filename used with fout , essentially recording a real-time performance)

The current required full pathname - /storage/emulated/0/Music/ - doesn't work with versions earlier than Michael's current Csound for Android on play.google.com. (CsdPlayer is a good example of such an earlier version; there were many of these, including a number of late Csound5 and 6.01 versions that my son and I came up with, and that are available on my website)

Neither does a simple filename work, or something like /Music/ .

Or was perhaps writing a .wav not an option with earlier versions?

I've tried many earlier versions on the same fairly recent Android smartphone. I'd like to create Android .csd's that will run on any recent Android device, but including earlier editions of Android Csound which all have somewhat different features - especially different GUIs (i.e, numbers of performance controls).
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here