Sonos Inc. shares tumbled more than 18% in after-hours trading Wednesday after the maker of smart speakers and other audio equipment fell short of expectations for its latest quarter and cut its forecast amid a "significantly more challenging" macroeconomic environment.