Audio Commands from the Terminal
Some Audio tools available in the terminal
There are several UNIX commands that Apple provides to help with audio. These are executed from the terminal.
afplay
applay allows you to play audio files from the command line.
Audio File Play
Version: 2.0
Copyright 2003-2013, Apple Inc. All Rights Reserved.
Specify -h (-help) for command options
afinfo
afinfo allows you to get information on an audio file.
Sample output
File: 2004.mp3
File type ID: MPG3
Num Tracks: 1
----
Data format: 2 ch, 44100 Hz, '.mp3' (0x00000000) 0 bits/channel, 0 bytes/packet, 1152 frames/packet, 0 bytes/frame
no channel layout.
estimated duration: 53.916735 sec
audio bytes: 1294001
audio packets: 2064
bit rate: 191999 bits per second
packet size upper bound: 1052
maximum packet size: 627
audio data file offset: 1027
optimized
audio 2375680 valid frames + 576 priming + 1472 remainder = 2377728
For me the most useful information is the Data format. In the above example, the 44100 Hz is a common sampling frequency - so the audio should play fine on most devices.
afconvert
afconvert converts file from one format to another.
Supported formats:
3GP Audio, 3GPP-2 Audio , AAC ADTS, AC3, AIFC, AIFF, amrf, m4af, m4bf, caff, ec-3, MPG1, MPG2, MPG3, mp4f, NeXT, Sd2f, WAVE
Interesting formats that is missing: oog (Common for streaming audio)
Sample output
# Converts MP3 to WAVE
afconvert -f WAVE -d LEI32 2004.mp3 -o 2004.wav
# FLAC
afconvert -f flac -d flac 2004.mp3 -o 2004.flac
afclip
afclip checks to see if your audio file has clipped sound - which is audio that is too loud and caused a clip.
Sample output
afclip 2004.mp3
afclip : "2004.mp3" 2 ch, 44100 Hz, '.mp3' (0x00000000) 0 bits/channel, 0 bytes/packet, 1152 frames/packet, 0 bytes/frame
-- no samples clipped --
afhash
afhash is an audio file hash
The purpose of the hashing at offsets close to the start and the end of the file is to ensure that if a TAG editing tool modifies either the beginning of the end of the file, at least one of the two hashes should survive and allow us to get meta-data on a specific file.
Sample output
afhash 2004.flac
2004.flac :
MD5 Hash in file : 41004751cb6cb5219a51e6935ec97b66
MD5 Hash of audio data : 41004751cb6cb5219a51e6935ec97b66
Hashes match.
2022 Gift Guide for Apple Fans
Practical Gifts for Tech Users
If you're on the hunt for the best gifts to buy an Apple fan this year, we've put together a helpful guide to point you in the right direction. While personal preference always plays a part in gift-giving, sometimes it can be hard to come up with any ideas for someone in your life who loves tech and Apple products.
The gifts in this guide largely relate to products created by Apple and third-party accessories that work well with Apple's devices. We've divided things up by Apple Products; Cases, Skins, and Screen Protectors; Charging; Audio; TVs; Smart Home; and Miscellaneous. Be sure to save this guide and browse it throughout the year whenever you need to buy a birthday gift or other present for a loved one.
Apple Products
If your budget allows for it, Apple has numerous devices that make for solid gift-giving ideas. If the person you're buying for subscribes to Apple Music, AirPods and HomePod mini are great companions to the streaming music service. For anyone active on your shopping list, the new Apple Watch SE is a great workout companion at an affordable price point.
- HomePod mini - A smaller version of the HomePod at a much more affordable price perfect for holiday gift-giving.
- AirPods 2 - The cheapest AirPods are getting on in years, but still make a great gift for the holidays, particularly at lower prices.
- AirPods 3 - Redesigned in 2021, AirPods 3 are the latest version of Apple's most beloved accessory.
- AirPods Pro - This model of the AirPods Pro now comes with a MagSafe Charging Case.
- Apple Pencil 2 - Pair a new Apple Pencil 2 with the latest iPad Air and iPad Pro models for a smooth illustrating or note-taking experience.
- Apple Watch 7 - The newest Apple Watch has an always-on Retina display and 20% more display area than the 6.
- 10.2-inch iPad - If you don't want to spend as much on an iPad Pro, Apple's entry level iPad got a 2021 update as well thanks to the A13 Bionic processor.
- iPad Air - The new iPad Air with an edge-to-edge 10.9-inch display and Touch ID power button.
- MacBook Pro - The all-new 14-inch and 16-inch MacBook Pros are the best all-around notebooks on the market, equipped with Apple's M1 Pro and M1 Max chips.
Cases, Skins, and Screen Protectors
With their cheap prices and small sizes, iPhone cases and screen protectors make for great, quick gifts. Of course, if you're looking for MacBook protection, companies like Pad & Quill and Twelve South offer solid options, and the growing popularity of AirPods has caused third-party brands to introduce some case options for the wireless headphones as well.
Cases for iPhone:
- Apple's Leather and Silicone Cases with MagSafe - Apple's newest iPhone cases, now enhanced with MagSafe.
- Nimble's iPhone Cases - Stylish, sparse cases that protect your new iPhone 12 from drops, with proceeds going toward eco-friendly causes.
- iPhone LED Cases - Phone led phone case is a case with multiple built-in LED lights. LED back panel blinks when you have an incoming call or notification.
- BodyGuardz Pure 2 EyeGuard - Protect your iPhone from drops and your eyes from harmful blue light effects.
MacBook Covers:
- Incase Hardshell Case for MacBook - Incase is well-known for its hardshell MacBook cases, which provide durable protection to Apple's laptops.
- Twelve South BookBook - Twelve South's BookBooks make your MacBook look like a vintage novel.
- Pad & Quill Leather Valet Case for 13-inch MacBook Pro ($160) - Fit your MacBook Pro, iPad, iPhone, Apple Pencil, cables, and more in Pad & Quill's leather case.
iPad Cover:
- Logitech Folio Touch for iPad Air - Logitech's keyboard comes in under the price of Apple's and has a bunch of useful features like a touch pad and backlit keyboard.
AirPods Cases:
- Elago's Cases for AirPods 1 & 2 - Stylish dual-tone protection for your AirPods.
- Elago AW6 AirPods Case - Protect your AirPods in a case that looks just like an iPod.
- Elago AirPods Pro Slim Case - A sleek case to protect your AirPods Pro.
Charging
Portable chargers are one of the best go-to gifts since most people can relate to needing a quick charge on their smartphone at one point during the day. Anker's popularity and reliability in the market remain strong, so you can't go wrong buying from them, but look to Choetech, RAVPower, and the new brand Nimble for a few other notable charging accessories options.
USB-C:
- Kingston Nucleum USB-C Hub - Expand your MacBook's ports with Kingston's USB-C Hub.
- OWC USB-C Travel Dock - Add up to five ports of expansion onto a MacBook Pro or iPad Pro.
Portable Batteries:
- Anker PowerCore 10,000 mAh Battery - Anker's PowerCore batteries are a backpack and travel necessity, and 10,000 mAh is a perfect mid-range size.
- Mophie powerstation USB-C XXXL - Mophie's powerhouse portable charging station offers a 26,000 mAh portable battery.
Wireless Chargers:
- Anker PowerWave Wireless Charging Mat - Wirelessly charge an iPhone 8 and newer on Anker's cheap-but-reliable mat.
- Belkin Boost Up Wireless Charging Dock - Wirelessly charge your iPhone, along with your Apple Watch, on Belkin's convenient and useful dock.
- Twelve South HiRise Wireless - Wirelessly charge your iPhone on the stand, then pop out the puck for an on-the-go Qi mat that perfectly fits the AirPods.
- Moshi Lounge Q Wireless Charging Stand - With an adjustable-height design and aesthetic inspired by Danish furniture, this Moshi charger fuels up your iPhone in style.
Roy Hart
Web enthusiast. Enjoy writing tech reviews. All-around dev & writer, an on-air contributor to various websites & magazines. My job entailed show prep, YouTube management, writing segments, running tests on different tech. |
Fix UnicodeEncodeError with BBEdit
Quick Easy Fix
Have you ever gotten this error when running your Python code:
UnicodeEncodeError: 'ascii' codec can't encode character 'u2019' in position 16520: ordinal not in range(128)
args = ('ascii', '<!DOCTYPE html>n<html lang="en">n <head>n <m...rigin="anonymous"></script>nnn </body>n</html>nn', 16520, 16521, 'ordinal not in range(128)')
encoding = 'ascii'
end = 16521
object = '<!DOCTYPE html>n<html lang="en">n <head>n <m...rigin="anonymous"></script>nnn </body>n</html>nn'
reason = 'ordinal not in range(128)'
start = 16520
with_traceback = <built-in method with_traceback of UnicodeEncodeError object>
This has been happening to me a lot when I convert code from PHP to Python. It was frustrating to fix the error. Someplace in my code is a piece of text that isn't translating well.
BBEdit to the Rescue!
The easy quick fix I found is in the Text Status Bar in BBEdit. The text status bar shows the file encoding,
Change the Python File Encoding!
By default the coding is Unicode (UTF-8)
However, if you change the file encoding to Western (ISO Latin 1) something magical happens when you save.
Unmappable character(s) detected.
If there's any Unicode in your file, it warns you and then tells you where the Unicode is so that you can fix it!
Once you fix all the errors the file will save and the UnicodeEncodeError should go away!
Sample Unmappable Characters dialog box that shows you what you need to fix!
Alternative Fix
If you get ordinal not in range(256) - Check out my solution.
If the error is results from a Database data, check out out this solution.
PermalinkEmmet in BBEdit
Code HTML faster in BBEdit
Emmet is an easy way for Web Developers to generate code from a series of shortcuts. It's a good tool for raw HTML and CSS developers.
Emmit support was include in BBEdit v.14 which was released in the summer of 2021.
Sample Emmet Command
div>ul>li*2
Using Emmit expands to:
<div>
<ul>
<li><# $1 #></li>
<li><# $2 #></li>
</ul>
</div>
Setting up Emmet in BBEdit
To use Emmet in BBEdit you need to install it. You use Node Package Manager (NPM) to install the files. ( Emmet NPM page)
Got NPM?
If you haven't installed NPM before, or don't know if you have it installed - you can always download the node installer from Nodejs.org
Download the NodeJS installer from Nodejs.org website: https://nodejs.org/
After doing the NPS install, you will need to run the NPM install command to install Emmet:
npm install emmet
Why not run the install command in BBEdit's Shell Worksheet?
Using Emmet in BBEdit
The important thing about using Emmet in BBEdit is that you use the "Expand Emmet Abbreviation" on the same line that you have type the abbreviation.
You do not select the text and then use the "Expand Emmet Abbreviation" command.
Copy the following into any BBEdit window:
h2.card-title>h5.card-subtitle>p*3
At the end of the line use the keyboard shortcut Shift F5 or select "Expand Emmet Abbreviation" from the Edit menu.
If your into Bootstrap, this is a good one to know:
card.mt-3>.card-header>.card-body
Output:
<card class="mt-3">
<div class="card-header">
<div class="card-body"><# $1 #></div>
</div>
</card>
That created the basic card area in the Bootstrap universe.
Learn More Emmet Snippets
You can learn more about Emmet commands from there website: https://docs.emmet.io/
PermalinkImage Tricks Pro
Practical Image Utility
Belight Software makes a lot of great Macintosh software - Image Tricks is a cool image utility.
Image Tricks is a quick image application. You would use this software to make a quick adjustment to an image for social media or blog posts.
Features of Image Tricks
Core Image Filters - Access to all the built-in Core Image Filter filters in the Core Image API. Adjustments like Transform, Color, Focus, Distortion, Style, Halftone, Tile, Lumine, and Overlap. Apple has 174 of them. Image Trick Lite users get 118, whereas Pro users get 160. (Not sure which Core Image Filers are not in Image Trick)
Quartz Compositions - Users get access to Stylize, Distortion, Utility, Other. Use this set of filters to create comic book-like effects on your images. Image Trick Lite users get 35, whereas Pro users get 41.
Image Generators - If you don't have a background image, why not use Image Tricks and create one. Image Trick Lite users get 13, whereas Pro users get 20. The nice thing is that after you generate a design, you can use the Quartz and Core Image Filters to touch it up.
Photo Frames - Quickly add a frame to your image. Some of these are not scaleable so your image may crop. Image Trick Lite users only get 12, whereas Pro users get 115.
Border Masks - Don't settle for boring square corners on your photos, add a border mask for an interesting effect. If you know how to create masks in Affinity Photo or Photoshop, this may not be an exciting feature. The advantage of Image Tricks is that they are super easy to apply and switch to see which design works best. Image Trick Lite users only get 35, whereas Pro users get 149.
Masks - These add image overlays to your image. Image Trick Lite users get 36, where as Pro users get 76.
Image Tricks Pro
You can buy Image Tricks Pro for $9.99 in the Apple Store or from their website.
One More Thing
Belight Software is based in Ukraine. As of today, all their developers are still in Ukraine. You can help support Ukraine Developers by purchasing their software. Following BeLight Software on Twitter for all the updates from the front lines.
I have been thinking of purchasing Image Tricks for years - I finally decided to purchase it to help support the Macintosh Developers in Ukraine. It's not an application that I plan to use a lot, but it seems the right time to buy.
PermalinkPath Finder 2021
Latest Update to the popular Finder replacement
PathFinder 10 was released earlier this month. The last update was on December 8, 2020. This means that there was a 1 year, 2 months, 5 days duration between major releases.
What is Path Finder?
Path Finder is a more advanced Finder. The application makes available a lot more tools to help increase your productivity.
People use Path Finder to:
- Perform Advance Search - Look for files in particular locations - such as certain USB drives.
- Manage Files - Easily move files from one location to another.
- Navigate - Using the Application Dock or the Menu icon, you can easily open up locations no matter where you are on your computer.
- Productivity - Power up the your finder with a lot of extra tools.
Let's check out the new features and see if it's worth the upgrade.
What's New in PathfinderCocoaTech is no longer adding the version to the PathFinder name. They are planning on releasing monthly updates and they felt having a version number in the name may confuse things.
Cocoatech has also moved Path Finder to a subscription model. This means that you now have to pay annual fees to get the latest version. They dropped the price, a yearly plan now costs $29.95. Path Finder 10 was $36.
Cloud Folder Uploader - You can easily send a file to any cloud service simply by right-clicking and uploading a file to SFTP/FTP, Amazon S3, Dropbox, and Google Drive servers.
Bug Fixes -Fixed issues with Terminal, git, and SVN modules
sFTP Cloud Uploader
The sftp integration is cool, it just takes a bit to get used to set up. Some tips I learned:
- The Remote Path is from the root directory when you log in to the sftp server. This isn't the absolute path, just the path you would take logging in.
- Make sure to end the Remote Path with a directory slash, example: images/website/
- Cocoatech should add a "Test Connection" button which would make it easier to see if you type the right password or file path.
You still can't mount an sftp server to Path Finder - maybe in a future release? Sending files to sFTP servers is a great first step.
Some Bugs with Monterey
There are still some issues with macOS Monterey. I am not seeing detailed information when I get file information. It seems to be working for macOS Catalina. (Apparently, this was supposed to be fixed in the 2121 version.)
I am also having some issues with the "Symbol Table" reports - works in Catalina but not in Monterey. This is pretty minor as a lot of people probable don't use this feature.
Revisiting Some Path Finder Features
Back in January 2021, I wrote about some of the new features of Path Finder 10, I thought it might be good to revisit a few of these features again.
File Rename - The file rename dialog allows you to have multiple criteria in renaming files. Really a good way to rename similar files. The before/after is really useful to see the impact of the changes before they are applied.
iPhone Viewer - Use the Size Browser to see where the largest files are being kept on your phone.
Application Switcher - See all the available applications on your computer. Not just the applications in the ~/Applications folder. This is available in the menu bar
Photoscape 4.2.1 Update
List of the Latest Features
It has been a while since I posted an update of all the features in PhotoScape X. This week's post is look at some of the features added since my .PhotosScape Update in November 2020.
Version 4.2 shipped in January 2022. This is the release note on the new features:
- New Object Effects: Inner Glow, Inner Shadow, Emboss
- New Image Effects: Outline
- Added Background, Fill, Color, Masks options to Image and Sticker Objects
- Added Mask option to Color and Film Effects
- Added Close menu to Collage tab
- Added 'Merge Selected Layers' to Editor tab
- Added 'Font Favorites'
- Added 'WEB Quality option'
- Added 32 Camouflage Patterns
- Added 180 Flower Stickers
- Added 469 more Pixel Stickers
- Selecting and Editing Multiple Objects
- Improved Object Effects: Long Shadow, Overlays & Masks
- Improved Shadows/Highlights Filter
- Improved Ul
- Fixed bugs
Quick Sample of some the the features in this update
Six Things I Learned from the New update
This update was a month late! In the past, PhotoScape did their major updates in Oct/Dec. I am not complaining, I just like to see what cool things that the PhotoScape team comes up with.
The Inner Glow, Inner Shadow are great ways to add make text objects stand out more.
Webp capability - Now I can save files in Webp format and see the savings using that format. (For example, the image used in this Blog post is 40 KB had I used Jpeg format it would have been 76 KB)
Note: Affinity Photo, Affinity Designer, and Graphic Converter don't offer support for Webp. Pixelmator Pro does allow users to save in Webp format but PhotoScape is the only app that I have that shows the preview of the saved image.
Font Favorites are a great addition! Now I can quickly switch between fonts and not have to scroll the long menu just to get to a font that I want.
The flower stickers and pixel stickers are nice, but I don't think that I'll ever use them. I guess its a good way to create a comic graphic? There's a lot of variety in the Pixel stickers, certainly worth a scroll through to get ideas.
The Camouflage Patterns are a nice addition to the large pattern library. They add a nice touch as a background color in text. I didn't realize that there were 32 different camouflage patterns.
PermalinkLuminar Neo
Version One Released today
This week, Skylum finally shipped version 1 of Luminar Neo. In this release users get the Core Luminar features, Remove Dust Spots, Relight, Remove Powerlines, Luminar Share, Presets and Layers.
In a later release the Mask and Portrait Background removal will be available - there is no date on when that release will occur. It will be a free update.
Product Description
Luminar Neo is a creative image editor driven by AI technologies of the future. It empowers creators to bring their boldest ideas to life. And enjoy it.
With leading-edge AI technologies and a flexible workflow, Luminar Neo allows users to accomplish creative tasks and achieve professional editing results. The new engine in Luminar Neo is based on all the best solutions from our experience at Skylum for maximum performance and flexibility, allowing you to achieve complex creative results.
Before/After
Check out how Luminar Neo transformed a boring church photo into something awesome:
This photo was taken using the GoPro Hero 9.
Key Features of Luminar Neo
Features not available in other Luminar products
Luminar Neo's goal is to make a single image look awesome. Luminar AI is designed more for batch editing, like Lightroom
Specific features not found in Luminar AI: Relight, Develop and Crop.
Relight is the ability to change the lighting in a photo. You can add or darken an image with a simple click. The cool thing is that Neo produces a 3D map so the light spreads naturally in the photo.
Develop is you opportunity to change the Exposure, Smart Contrast, Highlights, and shadows.
Crop is very similar to the Composition tool in Luminar AI. Clicking on Crop gives you the best crop image - making sure that the portrait's eyes are in the center of the image. Luminar AI adds Persecution and Image 3D Transform.
Argumented Sky Removal. It's interesting to note that Luminar decided to remove Argumented Sky in Luminar Neo. Argumented Sky is where you can place objects in the photo such as the moon or a rainbow. I recall seeing it in early versions but that feature is now gone.
You can get advice and tips from the Luminar Insider Form. The form is an active place of die-hard photo users. They frequently run contests for the best photos or styles.
Luminar Neo has Presets just like Luminar AI. When I ran the same image, the preset suggestions were the same. However, I rarely use these and would rather spend a few minutes in the editor fine-tuning the image using the awesome tools.
PermalinkForkLift 3
Is it a better alternative to Panic Transmit?
ForkLift by BinaryNights is a very popular dual file manager. In 2012, I did a quick review of the application and things have changed a lot over the years, so I thought it would be good to review it again.
My go-to FTP file manager is Panic Transmit, so this review is based on the things that ForkLift does well and some things where Transmit does a better job.
Five Things I Like about ForkLift 3
Commands - The Command menu option allows you to send various server commands without having to open up a separate terminal window. You can make symlinks, alias, sync, compress, copy, and delete to name a few.
Local File Size - You can quickly tell how much space you have on your local devices, if you are run low on disk space, the ???pill??? color will be red.
Sidebar - You can have the sidebar visible whenever you need it. This makes it easy to navigate between favorites and local devices while still having a two-panel window visible. This would be useful when migrating a site from one cloud service to another.
Custom Shortcuts - You can set or change any Forklift preferences. This means that I can quickly navigate through the application using shortcuts that I am familiar with.
Forklift Mini - This puts some features of ForkLift in the menu bar. For each favorite, you can mount it as a disk, open it as a droplet or open the location in Forklift. To mount it as a disk you need to install ???FUSE for macOS??? a free third-party framework,
Two Things That Panic Transmit Did Better
Apple iCloud Drive - When viewing iCloud folders, Forklift doesn???t show files that haven???t been downloaded. Panic Transmit does show non-downloaded files.
Connecting Servers - I spent way too much time looking at how to connect a server. In Transmit, the connection location is easy to find and the interface is much better.
Recommendation?
Overall, I think Transmit is a great application and won't be switching to ForkLift anytime soon. However, if I fund that ForkLift is running a sale, I may consider purchasing as a secondary FTP tool.
PermalinkSmart Folders
Create Quick Search for Common Searches
In this short entry, we are going to explore Smart Folders in the Finder - a way to quickly find common files at a click.
Smart Folders
Apple's description of Smart Folders:
Smart Folders automatically gather files by type and subject matter. Smart Folders are updated as you change, add, and remove files on your Mac.
Creating a Smart Folder
To create a smart folder: In the finder select the New menu then "New Smart Folder."
Tips and Tricks
Here are four useful Smart Folders to have:
Template Files
Template files - Are their files that you like to use on a frequent bases? Create a template so you can find them. (Apple Motion files in this example.)
Recent Apps
Recent Apps - Highlight applications that you use on a regular bases. The cool thing is that you can decide on the last open date.
Recent Files
Recent Files -Do you work with a lot of files and want quick access to the most recent ones? Set up a recent
Media Search
Specific Video Files - Do you frequently look for videos taken with a certain camera? Create a Smart Folder.
Full List of Search Attribute
There are 144 Spotlight Criteria and Attributes.
You can get the full list of all the available Spotlight search attributes on https://simonbarnett.co.za/ website.
PermalinkAbout
A Mac veteran since 1989, I'm here to share my experience with tips and tricks every Friday. Witnessing the evolution of Mac software and hardware firsthand, I've gained a deep understanding of how these machines work and can help you troubleshoot any issues that may come up.
Check out all the blog posts.
Schedule
Thursday | New England |
Friday | Macintosh |
Saturday | Internet Tools |
Sunday | Open Topic |
Monday | Media Monday |
Tuesday | QA |
Wednesday | iPhone 14 Pro Max |
Other Posts
- Snagit 2020
- Disk Inventory X
- PhotoScape X December Update
- AppleScript Sample
- Top 5 Macintosh Friday Blog Posts of 2023
- Mission Control
- Unarchiver
- Apple Mail HTML Support
- Filmora 9
- Griffin iMic
- Luminar 2018
- PhotoScape Color Picker
- TextSoap
- How to Clean Up Your iCloud Drive
- Scanning Multiple Images using Image Capture