#StorageFile
Explore tagged Tumblr posts
fabuloustorture · 5 years ago
Photo
Tumblr media
Doculife 📚 💻 is personal document storage, reimagined. Organize, plan and collaborate visually. Drop the box and toting the drives. Doculife is your new best friend. Given the current climate, Doculife is donating a free year of Doculife Unlimited to help everyone working and learning from home. Between now and May 30, choose Unlimited Yearly and enter code DOCULIFE365 at checkout to receive your FREE year. Doculife visually organizes your documents into beautiful galleries, so you can find what you need quickly. Import all of your documents easily using Doculife's many import options like the DocuSnap app, easily forward email attachments, or drag and drop right into your account. Organization is only half the story! Collaborate with friends, family, teachers, accountants, anyone! Create interactive documents with widgets. Widgets are super helpful things that augment your organized documents like adding a map, a route, a countdown timer, important contacts, videos and bookmarks. Create albums of anything in your @mydoculife account by clicking the link in my bio☝️ Shop this picture here👉 http://liketk.it/2MJfo @liketoknow.it #liketkit #StayHomeWithLTK #LTKfamily #LTKkids #lifeorganized #doculife #getorganized #hbtdoculifeq12020 #hbtsp #storagefiles #photostorage #family #goldendoodlesofinstagram #loveourdoodle #anayanj #stayathomedogmom #mamasboy (at Destin, Florida) https://www.instagram.com/p/B-x65ZUAz_0/?igshid=1oj7mfw4wnryb
0 notes
epic-games-official · 8 years ago
Text
unity is.. not being nice..... make it stop
2 notes · View notes
knowledgewiki · 6 years ago
Text
How to save SpeechSynthesis audio to a Mp3 file in a UWP application
I’m working on a UWP TTS (Text to Speech) application and I’m having trouble saving speech to a file, preferably in Mp3 format. Does anyone know how to do this? In WPF, I used NAUDIO and NAUDIO.LAME, but unfortunately this does not seem to support UWP. I think I have to use Windows.Media.Transcoding API, but I didn’t find any examples of how to do that. I found the code below in an article on MSDN, but it is not correct.
StorageFile file = await savePicker.PickSaveFileAsync(); if (file != null) { try { SpeechSynthesisStream stream = await WCSVariables.Synthesizer.SynthesizeTextToStreamAsync(rtbText.Text); using (var reader = new DataReader(stream)) { await reader.LoadAsync((uint)stream.Size); IBuffer buffer = reader.ReadBuffer((uint)stream.Size); await FileIO.WriteBufferAsync(file, buffer); } } catch (Exception ex) { MessageDialog msgdlg = new MessageDialog(ex.Message); msgdlg.ShowAsync(); }
********** UPDATE **********
After adding capabilities and file type associations for TXT and MP3, I was able to save the TXT files in any folder, but the MP3 files do not have the correct format. Files are created but do not play audio.
FileSavePicker savePicker = new FileSavePicker(); savePicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary; savePicker.FileTypeChoices.Add("Mp3 Audio File", new List<string>() { ".mp3" }); savePicker.FileTypeChoices.Add("Plain Text", new List<string>() { ".txt" }); savePicker.SuggestedFileName = "New Document"; StorageFile file = await savePicker.PickSaveFileAsync(); if (file != null) { try { if (file.FileType == ".txt") { await FileIO.WriteTextAsync(file, rtbText.Text); } else { string path = file.Path.Remove(file.Path.IndexOf(file.Name), file.Name.Length); StorageFolder mp3Folder = await StorageFolder.GetFolderFromPathAsync(path); StorageFile mp3File = await mp3Folder.CreateFileAsync(file.Name, CreationCollisionOption.ReplaceExisting); SpeechSynthesisStream stream = await WCSVariables.Synthesizer.SynthesizeTextToStreamAsync(rtbText.Text); using (var reader = new DataReader(stream)) { await reader.LoadAsync((uint)stream.Size); IBuffer buffer = reader.ReadBuffer((uint)stream.Size); await FileIO.WriteBufferAsync(mp3File, buffer); } } } catch (Exception ex) { MessageDialog msgdlg = new MessageDialog(ex.Message); msgdlg.ShowAsync(); } }
1 Answer
You can first create a .mp3 file and then generate a speech audio stream from a basic text string. After that, write the stream to the file.
StorageFolder folder = KnownFolders.VideosLibrary; StorageFile file = await folder.CreateFileAsync("MyVideo.mp3",CreationCollisionOption.ReplaceExisting); if (file != null) { try { var synth = new Windows.Media.SpeechSynthesis.SpeechSynthesizer(); SpeechSynthesisStream stream = await synth.SynthesizeTextToStreamAsync("Hello World"); using (var reader = new DataReader(stream)) { await reader.LoadAsync((uint)stream.Size); IBuffer buffer = reader.ReadBuffer((uint)stream.Size); await FileIO.WriteBufferAsync(file, buffer); } } catch {} }
Archive from: https://stackoverflow.com/questions/59061345/how-to-save-speechsynthesis-audio-to-a-mp3-file-in-a-uwp-application
from https://knowledgewiki.org/how-to-save-speechsynthesis-audio-to-a-mp3-file-in-a-uwp-application/
0 notes
blockcontech-blog · 6 years ago
Text
Getting started with SQLite in Windows Store / WinRT apps
In this blog post I will expand the blog post by Tim Heuer  to include information on how to include and access a pre-populated SQLite database file, maybe even a file created by migrating from a SQL Server Compact database file, as I blogged about recently. First, download the "SQLite for Windows Runtime" Extension via Tools/Extensions and Updates/Online. Restart Visual Studio. Then add references to the SQLite and C++ extensions as described by Tim Heuer. Remember to change the Build Configuration to either x64 or x86 in Configuration Manager. Now add the sqlite-net nuget package to the project, from the References node, select "Manage NuGet Packages" and search online for "sqlite-net": This will add SQLite.cs and SQLiteAsync.cs to your project. Now add the SQLite database file to your project as Content: + If you want the database file to be writeable, you will have to copy it to your local appdata folder. Keep in mind, that when your app is uninstalled, the file will be removed. You can use code like the following to ensure that the file has been copied:private string dbName = "chinook.db";private async void LoadData() { await CreateIfNotExists(dbName); } private async Task CreateIfNotExists(string dbName) { if (await GetIfFileExistsAsync(dbName) == null) { StorageFile seedFile = await StorageFile.GetFileFromPathAsync( Path.Combine(Windows.ApplicationModel.Package.Current.InstalledLocation.Path, dbName)); await seedFile.CopyAsync(Windows.Storage.ApplicationData.Current.LocalFolder); } } private async Task GetIfFileExistsAsync(string key) { try { return await ApplicationData.Current.LocalFolder.GetFileAsync(key); } catch (FileNotFoundException) { return default(StorageFile); } } And code like this to access data (see the sqlit-net site for more samples) https://github.com/praeclarum/sqlite-netprotected override void OnNavigatedTo(NavigationEventArgs e) { var dbPath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, dbName); using (var db = new SQLite.SQLiteConnection(dbPath)) { var list = db.Table().OrderBy(a => a.Name).ToList(); } } //This would reside in another file or even project public class Artist { public int ArtistID { get; set; } public string Name { get; set; } } public class Album { public int AlbumID { get; set; } public string Name { get; set; } public int ArtistID { get; set; } } Hope this will be able to get you started using SQLite with your Windows Store app. You can download the complete sample with a database file from this link (all code above is in MainPage.xaml.cs): http://sdrv.ms/Pd1xeL
0 notes
windowsapptutorials · 9 years ago
Text
How to get the file size of Storage File in Windows phone app
How to get the file size of Storage File in Windows phone app #wpdev http://wtuts.me/filesize
StorageFile class provides different methods with the help of which we can retrieve the file size of a give StorageFile.
  In the given function below we retrieve the file size of a given StorageFile using GetBasicPropertiesAsync() method. This method returns the basic properties of the given Storagefile in form of class object from which we can get the size of the given StorageFile.
  https://gis…
View On WordPress
0 notes
windowsapptutorials · 9 years ago
Text
Convert StorageFile to a BitmapImage in Universal Windows Apps
Convert StorageFile to a BitmapImage in Universal Windows Apps
We have already seen how to convert a WritableBitmap to a StorageFile in Universal Windows apps.
  A StorageFile can be converted to a BitmapImage using the following function.
public class ImageUtils { public static async Task StorageFileToBitmapImage(StorageFile savedStorageFile) { using (IRandomAccessStream fileStream = await savedStorageFile.OpenAsync(Windows.Storage.FileAccessMode.Read)) {…
View On WordPress
0 notes
windowsapptutorials · 9 years ago
Text
Converting WritableBitmap to StorageFile in Universal Windows Apps
WriteableBitmap is quite useful when an app requires image processing. It provides a BitmapSource, that can be written and manipulated. Ultimately that bitmap source is supplied to an image control of a Windows Store app. We are going to save the WritableBitmap to a StorageFile in our app.
For image encoding WinRT offers the BitmapEncoder class. For image encoding we need to select a BitmapEncode…
View On WordPress
0 notes